-->
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.  [ 5 posts ] 
Author Message
 Post subject: help!
PostPosted: Mon Jan 12, 2004 6:30 am 
Newbie

Joined: Mon Jan 12, 2004 6:26 am
Posts: 10
i want to use this sql:
"select * from tablename where length(fieldname)=6"
but in hibernate how can i do this?
thanks!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 8:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Map your class to the table and then just use length(class.property) in your HQL query - you can use db-specific functions in the where clause of HQL querys.


Top
 Profile  
 
 Post subject: thanks gloeglm,another question.
PostPosted: Mon Jan 12, 2004 9:06 pm 
Newbie

Joined: Mon Jan 12, 2004 6:26 am
Posts: 10
since it can use sql function in hibernate.can i call the procedure in the oracle db just like the jdbc?


Top
 Profile  
 
 Post subject: thanks gloeglm!!
PostPosted: Mon Jan 12, 2004 9:07 pm 
Newbie

Joined: Mon Jan 12, 2004 6:26 am
Posts: 10
since it can use sql function in hibernate.can i call the procedure in the oracle db just like the jdbc?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 9:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Yes - if I understand your question correctly. You can use length() in the where part of your HQL.


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