Max Rydahl Andersen schrieb:
btw. just got
aware by a tip and re-reading that EJB3 actually have lazy fetching of
properties (got to keep up ;).
@Basic
protected String name;
@Basic(fetch=LAZY)
protected byte[] pic;
so, there you have it - this one will always fetch name, but only lazy
load pic when needed. Problem solved.
/max
I was aware of that lazy fetching feature. Once k objects of this type
have been lazy-loaded, how do you get all of them loaded with all
fields in one SELECT statement afterwards? The lazy-fetch
annotation will hinder you from doing exactly that. We need both
lazy-fetching and eager-fetching in this use-case, and EJB3 can't
provide that for the same class at the same time.
|