Author: struberg
Date: Sat Jan 24 09:24:57 2015
New Revision: 1654485

URL: http://svn.apache.org/r1654485
Log:
OPENJPA-2558 add proper logging for BooleanRepresentation

Modified:
    
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java
    
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    
openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties

Modified: 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java?rev=1654485&r1=1654484&r2=1654485&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java
 (original)
+++ 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java
 Sat Jan 24 09:24:57 2015
@@ -101,6 +101,7 @@ public class BooleanRepresentationFactor
 
     }
 
+
     public static BooleanRepresentation valueOf(String 
booleanRepresentationKey, ClassLoader cl) {
         // 1st step, try to lookup the BooleanRepresentation from the default 
ones
         BooleanRepresentation booleanRepresentation = 
BUILTIN_BOOLEAN_REPRESENTATIONS.get(booleanRepresentationKey);
@@ -121,7 +122,6 @@ public class BooleanRepresentationFactor
             }
             catch (Exception e) {
                 // nothing to do
-                //X TODO probably log some error?
             }
         }
 
@@ -133,9 +133,6 @@ public class BooleanRepresentationFactor
             ));
 
         }
-        else {
-            //X TODO add logging about which one got picked up finally
-        }
 
         return booleanRepresentation;
     }
@@ -192,6 +189,11 @@ public class BooleanRepresentationFactor
         public Boolean getRepresentation(boolean bool) {
             return bool;
         }
+
+        @Override
+        public String toString() {
+            return "BooleanBooleanRepresentation";
+        }
     }
 
     public static class Int10BooleanRepresentation implements 
BooleanRepresentation<Integer> {
@@ -209,6 +211,11 @@ public class BooleanRepresentationFactor
         public Integer getRepresentation(boolean bool) {
             return bool ? 1 : 0;
         }
+
+        @Override
+        public String toString() {
+            return "Int10BooleanRepresentation";
+        }
     }
 
 }

Modified: 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1654485&r1=1654484&r2=1654485&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
 (original)
+++ 
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
 Sat Jan 24 09:24:57 2015
@@ -5689,6 +5689,9 @@ public class DBDictionary
         booleanRepresentation = evaluatedBooleanRepresentation != null
                                     ? evaluatedBooleanRepresentation
                                     : BooleanRepresentationFactory.INT_10;
+        if (log.isInfoEnabled()) {
+            log.info(_loc.get("using-booleanRepresentation", 
booleanRepresentation));
+        }
     }
 
     protected boolean isUsingRange(long start, long end) {

Modified: 
openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties?rev=1654485&r1=1654484&r2=1654485&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
 (original)
+++ 
openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
 Sat Jan 24 09:24:57 2015
@@ -210,9 +210,9 @@ cannot-determine-identifier-base-case: U
     identifiers.  The default value of "{0}" will be used.
 can-not-execute: Unable to execute {0}.
 psql-owned-seq-warning: Unable to determine which sequences are owned by the 
database. \
-       OpenJPA will consider all sequences suffixed with "_seq" as database 
managed.  This \
-       may result in improper creation or removal of sequences with this 
suffix. The \
-       original PostgreSQL driver exception is being logged for your reference.
+    OpenJPA will consider all sequences suffixed with "_seq" as database 
managed.  This \
+    may result in improper creation or removal of sequences with this suffix. 
The \
+    original PostgreSQL driver exception is being logged for your reference.
 sequencesql-override: Going to override the DB2 specific default for the \
     DBDictionary.sequenceSQL string, which is: "{0}" \
     with the value of: "{1}", which is the default sequenceSQL string for DB2 
on the give operating system.  \
@@ -227,9 +227,11 @@ oracle-set-clob-warning: Setting the sup
 jdbc4-setbinarystream-unsupported: The JRE or JDBC level in use does not 
support the \
     JDBC 4.0 version of the "java.sql.PreparedStatement.setBinaryStream" 
method which is \
     necessary when the property 
"openjpa.jdbc.DBDictionary=useJDBC4SetBinaryStream" is \
-    set to true.  A prior version of this method will be used.    
+    set to true.  A prior version of this method will be used.
 sequence-cache-warning: Setting the useNativeSequenceCache property on the 
DBDictionary no longer has an \
     effect.  Code has been added to allow, by default, the functionality 
provided in previous releases \
     via the useNativeSequenceCache property.
-unknown-booleanRepresentation: Unknown BooleanRepresentation {0}. Value must 
be one of {1}.
-    
+unknown-booleanRepresentation: Unknown BooleanRepresentation {0}. Value must 
be one of {1}. You can also ˜\
+    hand over a 'truerepresentation/falserepresentation' String or a fully 
qualified class name of your \
+    own BooleanRepresentation implementation.
+using-booleanRepresentation: BooleanRepresentation {0} got picked up.


Reply via email to