public void initialize(AbstractSession session) throws DescriptorException {
if (!(Helper.classImplementsInterface(getDescriptor().getJavaClass(), ClassConstants.FetchGroupTracker_class))) {
//to use fetch group, the domain class must implement FetchGroupTracker interface
session.getIntegrityChecker().handleError(DescriptorException.needToImplementFetchGroupTracker(getDescriptor().getJavaClass(), getDescriptor()));
}
this.minimalFetchGroup = new FetchGroup();
this.fullFetchGroup = new FetchGroup();
for (DatabaseMapping mapping : getDescriptor().getMappings()) {
String name = mapping.getAttributeName();
if(mapping.isPrimaryKeyMapping()) {
this.minimalFetchGroup.addAttribute(name);
}