I have an issue that might be JPA/Hibernate-related, but it could also be
related to RequestFactory, so bear with me pls:

I have the following JPA @Entity-s:

class Profile {
   @OneToMany(cascade = CascadeType.ALL)
   List<Setting> settings = new ArrayList<Setting>();
   // other properties...
}

class Setting {
   @ManyToOne
   SettingDefinition definition;
   // other properties...
}

class SettingDefinition {
   // some properties - no relationships defined here
}

When a list of Profiles is displayed on a GWT UI (produced by Spring Roo,
which uses RequestFactory), all their properties are displayed fine, except
the individual Settings in the List have null SettingDefinitions even if
they're not null in the db (I checked). I tried fetching eagerly and
forcing it to not be null with:

@ManyToOne(fetch=FetchType.EAGER, optional=false)
SettingDefinition definition;

and also increasing the hibernate.max_fetch_depth to more than three
(AFAIK, 3 is the default), but I can't get the Settings to have their
corresponding SettingDefinitions when they come from the server. Is there a
setting or something that can be done to force these referenced entities so
that they are fetched?

(I posted this issue on the Roo forum but I've seen no response there:
http://forum.springsource.org/showthread.php?124490-Fetching-eagerly-on-Lists-1-n
If
this can be solved by the RequestFactory framework, this should be the
right place to ask).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to