Code example for EntityVerifyVersionProcess

0
	 * @see org.hibernate.dialect.lock.LockingStrategy#lock 
	 */ 
	public void lock( 
      Serializable id,
      Object version, 
      Object object, 
      int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
			throw new OptimisticLockException( "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		} 
		EntityEntry entry = session.getPersistenceContext().getEntry(object);
		EventSource source = (EventSource)session;
		EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess(object, entry);
		// Register the EntityVerifyVersionProcess action to run just prior to transaction commit. 
		source.getActionQueue().registerProcess(verifyVersion);
	} 
 
	protected LockMode getLockMode() {
		return lockMode;
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE