-->
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.  [ 1 post ] 
Author Message
 Post subject: using Join in Hibernate
PostPosted: Wed Dec 05, 2007 12:25 pm 
Newbie

Joined: Wed Nov 28, 2007 9:36 am
Posts: 8
hi,

we have a dilema :

one option is to use Views in the DataBase in this case, and create entities with hibernate reverse engineering , for each view .

we have about 40-50 joins in our application in this stage.

the other option ,as i saw, is to do this join in HQL , such as this example :

List cats = session.createCriteria(Cat.class)
.createCriteria("kittens")
.add( Restrictions.like("name", "Iz%") )
.list();

the problem is that i read that there are problems with this solution:

1. retrieving too much rows (distinct issue)
2. the Criteria layer is hidden in our App , we use :
dao.addCriterion(dao.createCriterion(a,b))
so it will change our conception.

there is other opinion to use a "free" Sql and deliver it to the hibernate.

what is more easy , right , performance wise better , and will "cost" less to change in case of a change in the view .

please advise ,
thanks,
Yair


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.