-->
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: DAO and multiple fetching strategies
PostPosted: Thu Jan 17, 2008 3:08 pm 
Newbie

Joined: Fri Sep 28, 2007 5:51 am
Posts: 8
Hi,
I'm trying to develop my application using Hibernate, but still defining DAO's in order to persist objects.
I use a generic DAO with CRUD operations as "Don't Repeat the DAO" article and "Java Persistence with Hibernate" book suggests, plus a generic findAll() method.

My first question is: is that a good approach? I'm loosing some Hibernate features, such as the distinct load() an get() replaced by read() in my DAO...

Suppose, I need N+1(the default) different fetching strategies in my SomeHibernateDAO; I need to implement N methods such as:

getSomeWithRelated1()
getSomeWithAnotherRelated()
....
getSomeWithIHopeTheLastRelated()

where each one set a different Criteria for joins, in order to mantain a correct DAO pattern implementation?
If so, isn't too dispendious thinking that I could have a lot of views related to my root Some entity...(sorry, but my english is very poor)

A last question what is the best approach for displaying tables data in a jsp? never use lazy loading?

Thanks,
Fabio


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.