-->
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: i have a problem about session.createCriteria!pls help
PostPosted: Tue Nov 25, 2003 6:01 am 
Newbie

Joined: Wed Aug 27, 2003 2:49 am
Posts: 8
here is my code:

Code:
       MyClass querybean=new MyClass();
       querybean.setID("12321321");

      Criteria c=session.createCriteria(querybean.getClass());
        c.add(Example.create(querybean));
        List list= c.list();


i run it success.and the size of list is 1. it seem quite right!

but this list didn't contains the specified element which id equals "12321321".

ple help me!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 6:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well, then what does the list contain?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 8:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Example queries ignore the id property. This makes an incredible amount of sense if you think about it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 10:51 pm 
Newbie

Joined: Wed Aug 27, 2003 2:49 am
Posts: 8
gavin wrote:
Example queries ignore the id property. This makes an incredible amount of sense if you think about it.


ok.i see. ths


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.