@Override public LockModeType getLockMode(Object entity) { checkOpen(); if ( !isTransactionInProgress() ) { throw new TransactionRequiredException( "Call to EntityManager#getLockMode should occur within transaction according to spec" ); } if ( !contains( entity ) ) { throw exceptionConverter.convert( new IllegalArgumentException( "entity not in the persistence context" ) ); } return LockModeTypeHelper.getLockModeType( getCurrentLockMode( entity ) ); }
@Override public void lock(Object entity, LockModeType lockModeType, Map<String, Object> properties) { checkOpen(); checkTransactionNeeded(); if ( !contains( entity ) ) { throw new IllegalArgumentException( "entity not in the persistence context" ); } final LockOptions lockOptions = buildLockOptions( lockModeType, properties ); try { buildLockRequest( lockOptions ).lock( entity ); } catch (RuntimeException e) { throw exceptionConverter.convert( e, lockOptions ); } }
if ( !getSessionFactory().getSessionFactoryOptions().isAllowRefreshDetachedEntity() ) { if ( event.getEntityName() != null ) { if ( !contains( event.getEntityName(), event.getObject() ) ) { throw new IllegalArgumentException( "Entity not managed" ); if ( !contains( event.getObject() ) ) { throw new IllegalArgumentException( "Entity not managed" );
setCacheMode( refreshCacheMode ); if ( !contains( entity ) ) { throw exceptionConverter.convert( new IllegalArgumentException( "Entity not managed" ) );
@Override public LockModeType getLockMode(Object entity) { checkOpen(); if ( !isTransactionInProgress() ) { throw new TransactionRequiredException( "Call to EntityManager#getLockMode should occur within transaction according to spec" ); } if ( !contains( entity ) ) { throw exceptionConverter.convert( new IllegalArgumentException( "entity not in the persistence context" ) ); } return LockModeTypeHelper.getLockModeType( getCurrentLockMode( entity ) ); }
@Override public void lock(Object entity, LockModeType lockModeType, Map<String, Object> properties) { checkOpen(); checkTransactionNeeded(); if ( !contains( entity ) ) { throw new IllegalArgumentException( "entity not in the persistence context" ); } final LockOptions lockOptions = buildLockOptions( lockModeType, properties ); try { buildLockRequest( lockOptions ).lock( entity ); } catch (RuntimeException e) { throw exceptionConverter.convert( e, lockOptions ); } }
if ( !getSessionFactory().getSessionFactoryOptions().isAllowRefreshDetachedEntity() ) { if ( event.getEntityName() != null ) { if ( !contains( event.getEntityName(), event.getObject() ) ) { throw new IllegalArgumentException( "Entity not managed" ); if ( !contains( event.getObject() ) ) { throw new IllegalArgumentException( "Entity not managed" );
setCacheMode( refreshCacheMode ); if ( !contains( entity ) ) { throw exceptionConverter.convert( new IllegalArgumentException( "Entity not managed" ) );