-->
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.  [ 1 post ] 
Author Message
 Post subject: WHERE clause in Set element of hibernate...
PostPosted: Thu Aug 03, 2006 4:10 pm 
Newbie

Joined: Thu Aug 03, 2006 3:57 pm
Posts: 1
Hibernate version: 3.1

I am tring to use a set in one of my hibernate mappings that has a WHERE Clause in it. The clause needs to reference a table to grab the maximum date of a column. I am also working with a particular schema (default_schema in the hibernate config file), and I was wondering how to get at the schema name without explicitly typing it in.

<set name="aSet" inverse="true" lazy="false" where="prop1=SELECT MAX(Date) FROM SCHEMA_NAME.Table T">
<key>
<column name="col1" not-null="true" />
<column name="col2" not-null="true" />

</key>
<one-to-many class="test.TestClass" />
</set>


Is there some sort of substitution I could do like ${default_schema}, or something along those lines?

Thanks,
Jeremy


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

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.