-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Query language substitutions, Oracle
PostPosted: Tue Nov 04, 2003 2:15 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
We store booleans as 'Y', 'N' chars in our database, so I though I could do this:

Code:
<property name="hibernate.query.substitutions">true 'Y', false 'N'</property>


But I get this error:

Code:
(impl.SessionFactoryImpl             287 ) Query language substitutions: {false='N', true='Y'}

Hibernate: query.....

There was 1 error:
1) testOne(com.notiva.core.data.setup.DocumentGroupSetupDTEST)java.lang.NumberFormatException: N
   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)


Any my mapping is like so:
Code:
<property column="PROCESS_IN_FLAG" length="1" name="processInFlag" type="java.lang.Boolean"/>


I feel like I am missing something simple, any help?

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 5:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Why don't you use the yes_no hibernate type which maps to a Boolean. See documentation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.