-->
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: ISession.Get Vs ISession.CreateCriteria
PostPosted: Thu Oct 26, 2006 2:55 am 
Regular
Regular

Joined: Thu Aug 24, 2006 2:05 am
Posts: 80
Pb: If I want to fetch single entity from the database table then which one is the better option...ISession.Get(PrimaryKey) or ISession.CreateCriteria("EntityName").Add("Expression.Eq("PrimaryKeyName", value));

and also provide me the proper reason for the same.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 3:42 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
ISession.Get is faster because the query is pre-generated at startup, unlike criteria queries.

"and also provide me..." - has it ever occured to you that this sounds impolite? People here are all volunteers and may be put off by the tone of your posts.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 6:00 am 
Regular
Regular

Joined: Thu Aug 24, 2006 2:05 am
Posts: 80
Sorry, it was by mistake :(


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.