diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java index 14ad5d8a3..cdbdac83c 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java @@ -101,6 +101,7 @@ public class BooleanRepresentationFactory { } + 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 BooleanRepresentationFactory { } catch (Exception e) { // nothing to do - //X TODO probably log some error? } } @@ -133,9 +133,6 @@ public class BooleanRepresentationFactory { )); } - else { - //X TODO add logging about which one got picked up finally - } return booleanRepresentation; } @@ -192,6 +189,11 @@ public class BooleanRepresentationFactory { public Boolean getRepresentation(boolean bool) { return bool; } + + @Override + public String toString() { + return "BooleanBooleanRepresentation"; + } } public static class Int10BooleanRepresentation implements BooleanRepresentation { @@ -209,6 +211,11 @@ public class BooleanRepresentationFactory { public Integer getRepresentation(boolean bool) { return bool ? 1 : 0; } + + @Override + public String toString() { + return "Int10BooleanRepresentation"; + } } } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index 1d27652f0..0a601a30d 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -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) { diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties index cfb122bad..75662c225 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties @@ -210,9 +210,9 @@ cannot-determine-identifier-base-case: Unable to determine the case to use for \ 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 supportsSetClob property on the OracleDicti 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.