This content has been marked as final. Show 4 replies
REDO LOG wrote:Those are two different things.
I am about developing an JEE web application and I needed to implement what is do called lazy loading or pagination
The first one means that a part of an object graph won't be loaded unless it's needed (avoiding loading data that won't be used), the second means that only parts of a resultset are loaded.
I did some search and I found that JPA contains annotation to mark the fields of an entity as Lazy in fetchTypeThat's lazy loading of entities.
Please if anybody has a tutorial, a book, a web page that gives anything about my subject, I will be so thankful.Well, I have a web page for you: http://google.com
'Pro JPA 2.0' - buy it, love it. Additionally you may want to get the book 'Enterprise Javabeans 3.1' (O'Reilly) which is the best book I have read on EJB tech and may help to understand how JPA fits into the EJB landscape exactly.
Note that lazy loading and pagination have absolutely -nothing- to do with each other.
it is really a jungle I got really CONFUSED and miss understanding of the hole thingThat is because it is difficult material and not for the novice. It took me two years of hard daily practice before I was confident enough to state "I understand JEE"; and I already had a good 6 years of Java/web programming experience at that point.
REDO LOG wrote:Both techniques work actually (as long as you really make it a lazy initialization, which is something different than lazy loading), I just find PostConstruct a littler cleaner.
thanks I have solver the problem, I had to initialize the list in a PostConstruct annotated method instead of the getter