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: