-->
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.  [ 3 posts ] 
Author Message
 Post subject: QBE with primitive types
PostPosted: Thu Oct 21, 2004 10:54 am 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
Hi All,

I've scoured the forums & FAQs and I believe I know the answer to this, but I haven't seen it stated explicitly.

I'm trying to use Query by Example on entities that have primitive type properties. Since these can't be null, it seems the Hibernate engine adds those to the SQL as part of the where clause, even though I don't want them to be involved in the query.

This issue seems to be related somewhat to the use of primitive types to map nullable numeric database fields -- the null doesn't translate.

So it seems in this case that the only real solution (assuming QBE is the requirement) is to use Object types instead of primitives.

Is this a fair assessment? Is there any other workaround that would let me keep the primitive types? Is there any way to specify a default value of non-id properties?

Thanks a 10^6,

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 12:17 pm 
Beginner
Beginner

Joined: Fri Mar 26, 2004 8:19 am
Posts: 49
take out those primitives!

:-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can use the Example.excludeXXX() or a custom Example.PropertySelector to customize what properties are included/excluded


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.