public boolean isPersistent() { return this == GHOST || this == PART_RESOLVED || this == RESOLVED || isResolving() || isUpdating() || (isSerializing() && this != SERIALIZING_TRANSIENT); }
/** * Returns false while object is having its field set up. */ public boolean respondToChangesInPersistentObjects() { // note: SERIALIZING_TRANSIENT is included twice here, through either isTransient() or isSerializing() return !( isNew() || isTransient() || isResolving() || isUpdating() || isSerializing() ); }
public Object getEntity(final String entityName, final Serializable id) throws CallbackException { if (LOG.isDebugEnabled()) { LOG.debug("getEntity entityName=" + entityName + ", id=" + id); } final HibernateOid oid = new HibernateOid(entityName, id); final NakedObject adapter = NakedObjectsContext.getObjectLoader().getAdapterFor(oid); if (adapter != null) { LOG.debug("getEntity found naked object with same oid - " + oid); if (adapter.getResolveState().isGhost() || adapter.getResolveState().isPartlyResolved() || adapter.getResolveState().isResolving()) { // change for lazy loading objects - this prevents hibernate // picking up the GHOST object as an already loaded entity by only returning // the object if it is resolved return null; } return adapter.getObject(); } return null; }