/** * INTERNAL: * Called on attempt to get value of an attribute that hasn't been fetched yet. * Returns an error message in case javax.persistence.EntityNotFoundException * should be thrown by the calling method, * null otherwise. * <p> * This method is typically only invoked through woven code in the * persistence object introduced when {@link FetchGroupTracker} is woven * into the entity. */ public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName) { return onUnfetchedAttribute(entity, attributeName, null); }
/** * INTERNAL: * Called on attempt to assign value to an attribute that hasn't been fetched yet. * Returns an error message in case javax.persistence.EntityNotFoundException * should be thrown by the calling method, * null otherwise. * <p> * This method is typically only invoked through woven code in the * persistence object introduced when {@link FetchGroupTracker} is woven * into the entity. */ public String onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName) { return onUnfetchedAttribute(entity, attributeName); }
/** * INTERNAL: * Called on attempt to assign value to an attribute that hasn't been fetched yet. * Returns an error message in case javax.persistence.EntityNotFoundException * should be thrown by the calling method, * null otherwise. * <p> * This method is typically only invoked through woven code in the * persistence object introduced when {@link FetchGroupTracker} is woven * into the entity. */ public String onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName) { return onUnfetchedAttribute(entity, attributeName); }
/** * INTERNAL: * Load/fetch the unfetched object. This method is used by the ClassWaver.. */ public static void processUnfetchedAttribute(FetchGroupTracker entity, String attributeName) { String errorMsg = entity._persistence_getFetchGroup().onUnfetchedAttribute(entity, attributeName); if(errorMsg != null) { throw new IllegalStateException(errorMsg); // cuba: changed to IllegalStateException } }
/** * Called on attempt to get value of an attribute that hasn't been fetched yet. * Returns an error message in case exception should be thrown by the calling method, * null otherwise. */ @Override public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName) { if (entity._persistence_getSession() != null) { return super.onUnfetchedAttribute(entity, attributeName); } throw new IllegalStateException(ExceptionLocalization.buildMessage("cannot_get_unfetched_attribute", new Object[]{entity, attributeName})); }
@Override public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName) { if (entity instanceof BaseGenericIdEntity) { String[] inaccessible = BaseEntityInternalAccess.getInaccessibleAttributes((BaseGenericIdEntity) entity); if (inaccessible != null) { for (String inaccessibleAttribute : inaccessible) { if (attributeName.equals(inaccessibleAttribute)) return null; } } } if (cannotAccessUnfetched(entity)) return "Cannot get unfetched attribute [" + attributeName + "] from object " + entity; return wrappedFetchGroup.onUnfetchedAttribute(entity, attributeName); }
/** * Called on attempt to get value of an attribute that hasn't been fetched yet. * Returns an error message in case exception should be thrown by the calling method, * null otherwise. */ @Override public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName) { if (entity._persistence_getSession() != null) { return super.onUnfetchedAttribute(entity, attributeName); } throw new IllegalStateException(ExceptionLocalization.buildMessage("cannot_get_unfetched_attribute", new Object[]{entity, attributeName})); }
if (!fetchGroup.getAttributeNames().containsAll(group.getAttributeNames())) { fetchGroup.onUnfetchedAttribute((FetchGroupTracker)object, null);
if (!fetchGroup.getAttributeNames().containsAll(group.getAttributeNames())) { fetchGroup.onUnfetchedAttribute((FetchGroupTracker)object, null, group.toFetchGroup());
if (dpm.contains(propertyName)) { if (_persistence_getFetchGroup() != null) { String errorMsg = _persistence_getFetchGroup().onUnfetchedAttribute(this, propertyName); if (errorMsg != null) {
if (dpm.contains(propertyName)) { if (_persistence_getFetchGroup() != null) { String errorMsg = _persistence_getFetchGroup().onUnfetchedAttribute(this, propertyName); if (errorMsg != null) {
if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
if (!fetchGroup.getAttributeNames().containsAll(copyGroup.getAttributeNames())) { fetchGroup.onUnfetchedAttribute((FetchGroupTracker)original, null);
if (!fetchGroup.getAttributeNames().containsAll(copyGroup.getAttributeNames())) { fetchGroup.onUnfetchedAttribute((FetchGroupTracker)original, null);
return rootEntity._persistence_getFetchGroup().onUnfetchedAttribute(rootEntity, attributeName);
public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName, FetchGroup newFetchGroup) { if (rootEntity != null){ return rootEntity._persistence_getFetchGroup().onUnfetchedAttribute(rootEntity, attributeName);