@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final NativeSQLQueryNonScalarReturn that = (NativeSQLQueryNonScalarReturn) o; if ( alias != null ? !alias.equals( that.alias ) : that.alias != null ) { return false; } if ( lockMode != null ? !lockMode.equals( that.lockMode ) : that.lockMode != null ) { return false; } if ( !propertyResults.equals( that.propertyResults ) ) { return false; } return true; }
/** * @param lockOptions a collection of lock modes specified dynamically via the Query interface */ @Override protected LockMode[] getLockModes(LockOptions lockOptions) { if ( lockOptions == null ) { return defaultLockModes; } if ( lockOptions.getAliasLockCount() == 0 && ( lockOptions.getLockMode() == null || LockMode.NONE.equals( lockOptions.getLockMode() ) ) ) { return defaultLockModes; } // unfortunately this stuff can't be cached because // it is per-invocation, not constant for the // QueryTranslator instance LockMode[] lockModesArray = new LockMode[entityAliases.length]; for ( int i = 0; i < entityAliases.length; i++ ) { LockMode lockMode = lockOptions.getEffectiveLockMode( entityAliases[i] ); if ( lockMode == null ) { //NONE, because its the requested lock mode, not the actual! lockMode = LockMode.NONE; } lockModesArray[i] = lockMode; } return lockModesArray; }
if ( LockMode.PESSIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityPersister persister = entry.getPersister(); final Object nextVersion = persister.forceVersionIncrement( entry.forceLocked( entity, nextVersion ); else if ( LockMode.OPTIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityIncrementVersionProcess incrementVersion = new EntityIncrementVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( incrementVersion ); else if ( LockMode.OPTIMISTIC.equals( lockMode ) ) { final EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( verifyVersion );
public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } NativeSQLQueryNonScalarReturn that = ( NativeSQLQueryNonScalarReturn ) o; if ( alias != null ? !alias.equals( that.alias ) : that.alias != null ) { return false; } if ( lockMode != null ? !lockMode.equals( that.lockMode ) : that.lockMode != null ) { return false; } if ( propertyResults != null ? !propertyResults.equals( that.propertyResults ) : that.propertyResults != null ) { return false; } return true; } }
public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } NativeSQLQueryNonScalarReturn that = ( NativeSQLQueryNonScalarReturn ) o; if ( alias != null ? !alias.equals( that.alias ) : that.alias != null ) { return false; } if ( lockMode != null ? !lockMode.equals( that.lockMode ) : that.lockMode != null ) { return false; } if ( propertyResults != null ? !propertyResults.equals( that.propertyResults ) : that.propertyResults != null ) { return false; } return true; } }
@Override @SuppressWarnings("unchecked") public QueryImplementor setLockMode(String alias, LockMode lockMode) { if ( !LockMode.NONE.equals( lockMode ) ) { verifySettingAliasSpecificLockModes(); } getQueryOptions().getLockOptions().setAliasSpecificLockMode( alias, lockMode ); return this; }
/** * @param lockOptions a collection of lock modes specified dynamically via the Query interface */ protected LockMode[] getLockModes(LockOptions lockOptions) { if ( lockOptions == null ) { return defaultLockModes; } if ( lockOptions.getAliasLockCount() == 0 && ( lockOptions.getLockMode() == null || LockMode.NONE.equals( lockOptions.getLockMode() ) ) ) { return defaultLockModes; } //FIXME fix the alias issue: could be that the "default" lock mode in LockOptions does that already LockMode lockMode = lockOptions.getEffectiveLockMode( "dummyaliasaswedon'thaveany" ); if ( lockMode == null ) { //NONE, because its the requested lock mode, not the actual! lockMode = LockMode.NONE; } return new LockMode[] { lockMode }; }
/** * @param lockOptions a collection of lock modes specified dynamically via the Query interface */ protected LockMode[] getLockModes(LockOptions lockOptions) { if ( lockOptions == null ) { return defaultLockModes; } if ( lockOptions.getAliasLockCount() == 0 && ( lockOptions.getLockMode() == null || LockMode.NONE.equals( lockOptions.getLockMode() ) ) ) { return defaultLockModes; } // unfortunately this stuff can't be cached because // it is per-invocation, not constant for the // QueryTranslator instance LockMode[] lockModesArray = new LockMode[entityAliases.length]; for ( int i = 0; i < entityAliases.length; i++ ) { LockMode lockMode = lockOptions.getEffectiveLockMode( entityAliases[i] ); if ( lockMode == null ) { //NONE, because its the requested lock mode, not the actual! lockMode = LockMode.NONE; } lockModesArray[i] = lockMode; } return lockModesArray; }
/** * @param lockOptions a collection of lock modes specified dynamically via the Query interface */ protected LockMode[] getLockModes(LockOptions lockOptions) { if ( lockOptions == null ) { return defaultLockModes; } if ( lockOptions.getAliasLockCount() == 0 && ( lockOptions.getLockMode() == null || LockMode.NONE.equals( lockOptions.getLockMode() ) ) ) { return defaultLockModes; } // unfortunately this stuff can't be cached because // it is per-invocation, not constant for the // QueryTranslator instance LockMode[] lockModesArray = new LockMode[entityAliases.length]; for ( int i = 0; i < entityAliases.length; i++ ) { LockMode lockMode = lockOptions.getEffectiveLockMode( entityAliases[i] ); if ( lockMode == null ) { //NONE, because its the requested lock mode, not the actual! lockMode = LockMode.NONE; } lockModesArray[i] = lockMode; } return lockModesArray; }
if ( LockMode.PESSIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityPersister persister = entry.getPersister(); Object nextVersion = persister.forceVersionIncrement( entry.forceLocked( entity, nextVersion ); else if ( LockMode.OPTIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { EntityIncrementVersionProcess incrementVersion = new EntityIncrementVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( incrementVersion ); else if ( LockMode.OPTIMISTIC.equals( lockMode ) ) { EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( verifyVersion );
if ( LockMode.PESSIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityPersister persister = entry.getPersister(); Object nextVersion = persister.forceVersionIncrement( entry.forceLocked( entity, nextVersion ); else if ( LockMode.OPTIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { EntityIncrementVersionProcess incrementVersion = new EntityIncrementVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( incrementVersion ); else if ( LockMode.OPTIMISTIC.equals( lockMode ) ) { EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( verifyVersion );
if ( LockMode.PESSIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityTypeDescriptor descriptor = entry.getDescriptor(); final Object nextVersion = descriptor.forceVersionIncrement( entry.forceLocked( entity, nextVersion ); else if ( LockMode.OPTIMISTIC_FORCE_INCREMENT.equals( lockMode ) ) { final EntityIncrementVersionProcess incrementVersion = new EntityIncrementVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( incrementVersion ); else if ( LockMode.OPTIMISTIC.equals( lockMode ) ) { final EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess( entity, entry ); event.getSession().getActionQueue().registerProcess( verifyVersion );