FetchGroup nonReferenceFetchGroup = new FetchGroup();
for (DatabaseMapping mapping : getDescriptor().getMappings()) {
if(!mapping.isForeignReferenceMapping()) {
String name = mapping.getAttributeName();
if(this.defaultEntityFetchGroup == null || this.defaultEntityFetchGroup.containsAttribute(name)) {
nonReferenceFetchGroup.addAttribute(name);
}
}
}
this.addMinimalFetchGroup(nonReferenceFetchGroup);
this.nonReferenceEntityFetchGroup = getEntityFetchGroup(nonReferenceFetchGroup);