-->
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: SAPDB: mapping boolean values
PostPosted: Tue Nov 07, 2006 5:45 pm 
Newbie

Joined: Tue Nov 07, 2006 5:29 pm
Posts: 3
Hello!

I am using hibernate3 and Spring 2.0 for a webapplication. The Database used for ORM purposes is MAXDB / SAPDB 7.6.0

I have one big problem when I try to retrieve objects with HQL. All boolean values are converted to 1 (true) and 0 (false) when I try to execute a hql statement - Finder-Method e.g.:

Code:
from User where active = true


Hibernate transforms this to:

Code:
SELECT * FROM user where active = 1


The Version of MAXDB / SAPDB runs in the internal mode (not oracle mode or something else). MAXDB requires true and false but not 1 and 0.

I tried to add the following (in several variations) to my hibernate-config:

Code:
<prop key="hibernate.query.substitutions">true=true,false=false</prop>


It didn`t help. Has anybody had the same problem and found a solution?

Thank`s a lot.

Greetings

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 6:50 pm 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
try creating your own dialect

may be subclassing
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/SAPDBDialect.html

and override toBooleanValueString

_________________
Don't forget to rate


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.