-->
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: uuid and the id field query
PostPosted: Fri May 12, 2006 12:44 pm 
Newbie

Joined: Fri May 12, 2006 12:04 pm
Posts: 5
Code:
@Entity
class Foo
{
String id;
@Id
String uuid;
}


When I run a query such as:

EJB-QL:
select f from Foo where f.id = ?1

Hibernate uses the uuid in the where clause instead of the id column.

SQL:
select * from Foo where uuid = ?

but the expected query is

SQL:
select * from Foo where id = ?

How can I fix this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 10:11 am 
Newbie

Joined: Fri May 12, 2006 12:04 pm
Posts: 5
Does anyone have any idea?
Seems like Hibernate assumes that when you use id as a field name, it always has to be a primary key.


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.