-->
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: Issue select query based on composite user type
PostPosted: Mon Aug 25, 2008 8:13 pm 
Newbie

Joined: Mon Nov 26, 2007 4:10 pm
Posts: 6
I have a composite user type Currency with 2 columns: amount and currency_code.

I'm trying to select all records where amount is greater than 0 regardless of currency_code - and I don't see any way to do that.

I tried this query:

"select * from Product where cost.amount > 0"

as well as Criteria query:

crit.add(Restrictions.gt("cost.amount", 0))

and both failed with "unable to resolve amount property". Is there actually a way to accomplish this without using SQL query?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 25, 2008 8:24 pm 
Newbie

Joined: Mon Nov 26, 2007 4:10 pm
Posts: 6
Looks like CompositeUserType might be the answer. Reading up on that now.


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.