Hibernate 2.1.2. We have our booleans mapped as CHAR(1) in our
Oracle9i database. (we have lookup data pointing to a
DB2 db also) We would like to map/treat them as Booleans/booleans in our Hibernate POJO's. I added this mapping to the hibernate.cfg.xml:
Code:
<property name="hibernate.query.substitutions">true "Y", false "N"</property>
...and the property is mapped like so:Code:
<property column="HAS_NOTES_FLAG" length="1" name="hasNotesFlag" type="java.lang.Boolean"/>
...but no I continue to get this error:Code:
java.lang.NumberFormatException: Y
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1176)
at java.lang.Double.valueOf(Double.java:168)
at oracle.jdbc.driver.OracleStatement.getBooleanValue(OracleStatement.java:4393)
at oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.java:479)
at oracle.jdbc.driver.OracleResultSet.getBoolean(OracleResultSet.java:1494)
at net.sf.hibernate.type.BooleanType.get(BooleanType.java:19)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
at net.sf.hibernate.loader.Loader.hydrate(Loader.java:611)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:552)
Any ideas? This seems like it should be easy, but I have never gotten it working. I tried a few months back and gave up. I have tried every possible combination in the substitution mapping, single quotes, reversing the order, etc... Any help would be appreciated. Thanks.
Matt Dowell