Пример #1
0
 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);
 }
 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);
   }
 }