/** * 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})); }
/** * 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})); }
/** * Called on attempt to assign value to 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 onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName) { if (entity._persistence_getSession() != null) { return super.onUnfetchedAttributeForSet(entity, attributeName); } else { entity._persistence_setFetchGroup(new EntityFetchGroup(this, attributeName)); return null; } }
/** * Called on attempt to assign value to 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 onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName) { if (entity._persistence_getSession() != null) { return super.onUnfetchedAttributeForSet(entity, attributeName); } else { entity._persistence_setFetchGroup(new EntityFetchGroup(this, attributeName)); return null; } }
Session session = entity._persistence_getSession(); boolean shouldLoadResultIntoSelectionObject = false; if (session.isUnitOfWork()) {
Session session = entity._persistence_getSession(); if (session instanceof UnitOfWorkImpl) { if (((UnitOfWorkImpl) session).getLifecycle() >= UnitOfWorkImpl.Death) {