-->
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: brainy people - i need your help with composite identifiers
PostPosted: Wed Feb 01, 2006 12:06 pm 
Newbie

Joined: Fri Jan 27, 2006 7:52 am
Posts: 3
Hello,

I have the following queries:

a) If I do not have all the info to construct a composite identifier class, then how can I return a list of possibilities from the database? Do I have to list all and then match them manually? i.e. can i use wildcard values in my classes ;)

b) How do I reference fields of a composite key in HQL? (in my mapping file I have <key-property> and not <property>) My query returns an 'invalid identifier' error...

c) When I have cascade="all-delete-orphan", why is the generated SQL performing an UPDATE to the foreign key to make it null. Why does it not perform a delete on the children?

I am obviously missing something here and need some input from far brainier people than myself...

Many thanks

Cheerio,
Nic.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 5:48 pm 
Regular
Regular

Joined: Thu Sep 23, 2004 11:53 am
Posts: 83
a) If I do not have all the info to construct a composite identifier class, then how can I return a list of possibilities from the database? Do I have to list all and then match them manually? i.e. can i use wildcard values in my classes ;)

1) could query by example see the hibernate documenation for that
2) from County where id.county = 'harris' and id.state = 'MN'
3) from County where id.county = :county and id.state = :state
4) from County where id = :county (:county is replaced by the CountyId class)

How do I reference fields of a composite key in HQL? (in my mapping file I have <key-property> and not <property>) My query returns an 'invalid identifier' error..

see 2) 3) and 4) above

c) When I have cascade="all-delete-orphan", why is the generated SQL performing an UPDATE to the foreign key to make it null. Why does it not perform a delete on the children?

do not know the answer to this one.


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.