-->
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: HQL with property named id
PostPosted: Wed Mar 21, 2007 5:59 pm 
Beginner
Beginner

Joined: Wed May 05, 2004 12:45 pm
Posts: 21
Hello,

What happens if I have a property named id and I do an HQL query specifying feature.id. Will it take the column that represents the primary key or will it take the column represented by the property named id?

I know that id refers to the unique identifier of the object specified in my mapping file. How do you then differentiate between id that refers to the <id></id> section in the mapping or the property named id?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 6:17 pm 
Beginner
Beginner

Joined: Wed May 05, 2004 12:45 pm
Posts: 21
Ok I just renamed my property to Id and now I use feature.Id to refer to the property.

Still the same setter method is called setId() as before so no need to change the object.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 8:44 am 
Regular
Regular

Joined: Fri Feb 09, 2007 3:47 pm
Posts: 56
What if you cant change the id to Id, is there still an answer for this question as I am in the same position.

Thanks


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.