@Override public void forceLocked(Object entity, Object nextVersion) { version = nextVersion; loadedState[ persister.getVersionProperty() ] = version; // TODO: use LockMode.PESSIMISTIC_FORCE_INCREMENT //noinspection deprecation setLockMode( LockMode.FORCE ); persister.setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); }
@Override public void postUpdate(Object entity, Object[] updatedState, Object nextVersion) { this.loadedState = updatedState; setLockMode( LockMode.WRITE ); if ( getPersister().isVersioned() ) { this.version = nextVersion; getPersister().setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); } if( entity instanceof SelfDirtinessTracker ) { ( (SelfDirtinessTracker) entity ).$$_hibernate_clearDirtyAttributes(); } getPersistenceContext().getSession() .getFactory() .getCustomEntityDirtinessStrategy() .resetDirty( entity, getPersister(), (Session) getPersistenceContext().getSession() ); }
propertyName ); persister.getOwnerEntityPersister().setPropertyValue( lce.getCollection().getOwner(), propertyIndex,
@Override public void setPropertyValue(final Object object, final int i, final Object value) throws HibernateException { try { persister.setPropertyValue(object, i, value); } catch (final PersistenceException ex) { throw HibernateExceptionAdapter.adapt(ex); } }
private void synchronizePersisterState(Object entity, EntityPersister persister, Object[] state) { String[] propertyNames = persister.getPropertyNames(); for (int i = 0; i < propertyNames.length; i++) { String p = propertyNames[i]; MetaProperty metaProperty = domainMetaClass.getMetaProperty(p); if (ClosureEventTriggeringInterceptor.IGNORED.contains(p) || metaProperty == null) { continue; } Object value = metaProperty.getProperty(entity); state[i] = value; persister.setPropertyValue(entity, i, value, EntityMode.POJO); } }
public void forceLocked(Object entity, Object nextVersion) { version = nextVersion; loadedState[ persister.getVersionProperty() ] = version; //noinspection deprecation setLockMode( LockMode.FORCE ); // TODO: use LockMode.PESSIMISTIC_FORCE_INCREMENT persister.setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); }
public void forceLocked(Object entity, Object nextVersion) { version = nextVersion; loadedState[ persister.getVersionProperty() ] = version; setLockMode( LockMode.FORCE ); persister.setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion, entityMode ); }
public void forceLocked(Object entity, Object nextVersion) { version = nextVersion; loadedState[ persister.getVersionProperty() ] = version; //noinspection deprecation setLockMode( LockMode.FORCE ); // TODO: use LockMode.PESSIMISTIC_FORCE_INCREMENT persister.setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); }
public void postUpdate(Object obj, Object[] updatedState, Object nextVersion) { this.loadedState = updatedState; setLockMode(LockMode.WRITE); if ( getPersister().isVersioned() ) { this.version = nextVersion; getPersister().setPropertyValue( obj, getPersister().getVersionProperty(), nextVersion, entityMode ); } }
persister.getPropertyValue(entity, hbmReference.propertyIndex); if (referenceComparator.same(expectedObject, object)) { persister.setPropertyValue(entity, hbmReference.propertyIndex, null);
/** * After actually updating the database, update the snapshot information, * and escalate the lock mode */ public void postUpdate(Object entity, Object[] updatedState, Object nextVersion) { this.loadedState = updatedState; setLockMode(LockMode.WRITE); if ( getPersister().isVersioned() ) { this.version = nextVersion; getPersister().setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion, entityMode ); } FieldInterceptionHelper.clearDirty( entity ); }
persister.setPropertyValue(entity, idx, copy, source .getEntityMode()); if (!Hibernate.isInitialized(previous)) { log("Skipping uninitialized collection: ", propertyNames[i]); persister.setPropertyValue(entity, i, previous, source .getEntityMode()); } else { log("Copying nulled collection: ", propertyNames[i]); Collection copy = copy(((Collection) previous)); persister.setPropertyValue(entity, i, copy, source .getEntityMode()); if (!Hibernate.isInitialized(previous)) { log("Skipping uninitialized map: ", propertyNames[i]); persister.setPropertyValue(entity, i, previous, source .getEntityMode()); } else { Map copy = copy((Map) previous); persister.setPropertyValue(entity, i, copy, source .getEntityMode());
/** * Handle updating the internal state of the entry after actually performing * the database update. Specifically we update the snapshot information and * escalate the lock mode * * @param entity The entity instance * @param updatedState The state calculated after the update (becomes the * new {@link #getLoadedState() loaded state}. * @param nextVersion The new version. */ public void postUpdate(Object entity, Object[] updatedState, Object nextVersion) { this.loadedState = updatedState; setLockMode( LockMode.WRITE ); if ( getPersister().isVersioned() ) { this.version = nextVersion; getPersister().setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); } if ( getPersister().getInstrumentationMetadata().isInstrumented() ) { final FieldInterceptor interceptor = getPersister().getInstrumentationMetadata().extractInterceptor( entity ); if ( interceptor != null ) { interceptor.clearDirty(); } } persistenceContext.getSession() .getFactory() .getCustomEntityDirtinessStrategy() .resetDirty( entity, getPersister(), (Session) persistenceContext.getSession() ); notifyLoadedStateUpdated(); }
/** * Handle updating the internal state of the entry after actually performing * the database update. Specifically we update the snapshot information and * escalate the lock mode * * @param entity The entity instance * @param updatedState The state calculated after the update (becomes the * new {@link #getLoadedState() loaded state}. * @param nextVersion The new version. */ public void postUpdate(Object entity, Object[] updatedState, Object nextVersion) { this.loadedState = updatedState; setLockMode( LockMode.WRITE ); if ( getPersister().isVersioned() ) { this.version = nextVersion; getPersister().setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion ); } if ( getPersister().getInstrumentationMetadata().isInstrumented() ) { final FieldInterceptor interceptor = getPersister().getInstrumentationMetadata().extractInterceptor( entity ); if ( interceptor != null ) { interceptor.clearDirty(); } } persistenceContext.getSession() .getFactory() .getCustomEntityDirtinessStrategy() .resetDirty( entity, getPersister(), (Session) persistenceContext.getSession() ); notifyLoadedStateUpdated(); }