-->
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.  [ 4 posts ] 
Author Message
 Post subject: setEntity on a single table with no association
PostPosted: Tue Oct 26, 2004 2:12 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
I was wondering if the setEntity can be used on single table with no association with other table. For example, can I write a query like this:

Query query = session.createQuery("from user as u where u = :user");
query.setEntity("u", user);


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 2:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
That does not make sense at all ...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 2:21 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
Let 's say I have search page that allows a visitor to select some (optional) fields to search the "User" table. Is there a way that I can build a user object with field specified and then bind the object using a logic similar to setEntity rather than using Criterion to bind the fields selected by the visitor individually


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 2:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use the Query-by-Example api. Please read in the docs.


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