-->
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: org.hibernate.Criteria.getCriteriaClass ?
PostPosted: Wed Nov 30, 2005 2:49 am 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
What is difference between org.hiberate and net.sf.hibernate? the latter has Criteria.getCriteriaClass(). what is the equivalent method for the org.hibernate.Criteria?

List cats = session.createCriteria(Cat.class)
.add( Restrictions.like("name", "Iz%") )
.add( Restrictions.gt( "weight", new Float(minWeight) ) )
.addOrder( Order.asc("age") )
.list();

I am using EJB3.0.

How to get the class "Cat"? Thanks,
Dave


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 3:07 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
org.hiberate = version 3.x ; net.sf.hibernate = version 2

Criteria interface is implemented by CriteriaImpl. Each instance of CriteriaImpl has a method called getEntityOrClassName() .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 5:01 am 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
Thanks.

If I use DetachedCriteria which is a concrete class, it seems there is no way to getEntityOrClass when a session is not available. Is this a defect?


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.