public static boolean isLoaded(Object entity, String attributeName, DatabaseMapping mapping) {
if (mapping.isForeignReferenceMapping()) {
if (((ForeignReferenceMapping) mapping).isLazy()) {
Object value = mapping.getAttributeValueFromObject(entity);
IndirectionPolicy policy = ((ForeignReferenceMapping) mapping).getIndirectionPolicy();
return policy.objectIsInstantiated(value);
}
}
if (entity instanceof FetchGroupTracker) {
return ((FetchGroupTracker) entity)._persistence_isAttributeFetched(attributeName);