Code example for Lockable

Methods: getEntityName

0
	 */ 
	public OptimisticForceIncrementLockingStrategy(Lockable lockable, LockMode lockMode) {
		this.lockable = lockable;
		this.lockMode = lockMode;
		if ( lockMode.lessThan( LockMode.OPTIMISTIC_FORCE_INCREMENT ) ) {
			throw new HibernateException( "[" + lockMode + "] not valid for [" + lockable.getEntityName() + "]" );
		} 
	} 
 
	/** 
	 * @see LockingStrategy#lock 
	 */ 
	public void lock( 
			Serializable id,
			Object version, 
			Object object, 
			int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
			throw new HibernateException( "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		} 
Experience pair programming with AI  Get Codota for Java