LockMode lessThan - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for LockMode lessThan method.

This code example shows how to use the following methods:greaterThan, lessThan
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		//the BLOB type requires a size arguement - this defaults to 
		//bytes - no arg defaults to 1 whole byte! 
		//other argument mods include K - kilobyte, M - megabyte, G - gigabyte. 
		//refer to the PBdevelopers guide for more info. 
		registerColumnType( Types.VARBINARY, "blob($l)" );
		registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
	} 
 
	public String getAddColumnString() {
		return "add"; 
	} 
 

6
CodeRank
This code example shows how to use the following methods:greaterThan, lessThan
 */ 
public class FrontBaseDialect extends Dialect {
 
	public FrontBaseDialect() { 
		super(); 
 
		registerColumnType( Types.BIT, "bit" );
		registerColumnType( Types.BIGINT, "longint" );
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "tinyint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "bit varying($l)" );
		registerColumnType( Types.NUMERIC, "numeric($p,$s)" );

6
CodeRank
This code example shows how to use the following methods:greaterThan, lessThan
		registerColumnType( Types.BIGINT, "bigint" );
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "tinyint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "varbinary" );
		registerColumnType( Types.NUMERIC, "numeric" );
		registerColumnType( Types.BLOB, "blob" );
		registerColumnType( Types.CLOB, "clob" );
 
		registerFunction( "upper", new StandardSQLFunction("upper") );
		registerFunction( "lower", new StandardSQLFunction("lower") );
		registerFunction( "sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE) );
		registerFunction( "abs", new StandardSQLFunction("abs") );

5
CodeRank
This code example shows how to use the following methods:greaterThan, lessThan
 *  - user queries that does subqueries with aggregation 
 * No CLOB/BLOB support  
 * No cascade delete support. 
 * No Calendar support 
 * No support for updating primary keys. 
 *  
 * @author Sherry Listgarten and Max Andersen 
 */ 
public class TimesTenDialect extends Dialect {
	 
	public TimesTenDialect() { 
		super(); 
		registerColumnType( Types.BIT, "TINYINT" );
		registerColumnType( Types.BIGINT, "BIGINT" );
		registerColumnType( Types.SMALLINT, "SMALLINT" );
		registerColumnType( Types.TINYINT, "TINYINT" );
		registerColumnType( Types.INTEGER, "INTEGER" );
		registerColumnType( Types.CHAR, "CHAR(1)" );
		registerColumnType( Types.VARCHAR, "VARCHAR($l)" );
		registerColumnType( Types.FLOAT, "FLOAT" );

5
CodeRank
This code example shows how to use the following methods:greaterThan, lessThan
 * Also change the version displayed below in the constructor 
 * 1.1 
 * 1.0  2005-10-24  CDH - First dated version for use with CP 11 
 * 
 * @author Ploski and Hanson 
 */ 
public class RDMSOS2200Dialect extends Dialect { 
 
    private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, RDMSOS2200Dialect.class.getName()); 
 
	public RDMSOS2200Dialect() { 
		super(); 
        // Display the dialect version. 
        LOG.rdmsOs2200Dialect(); 
 
        /** 
         * This section registers RDMS Biult-in Functions (BIFs) with Hibernate. 
         * The first parameter is the 'register' function name with Hibernate. 
         * The second parameter is the defined RDMS SQL Function and it's 
         * characteristics. If StandardSQLFunction(...) is used, the RDMS BIF 

5
CodeRank
This code example shows how to use the following methods:lessThan
	 * @param lockMode Indicates the type of lock to be acquired. 
	 */ 
	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() + "]" );
5
CodeRank
This code example shows how to use the following methods:lessThan
	 */ 
	public PessimisticForceIncrementLockingStrategy(Lockable lockable, LockMode lockMode) {
		this.lockable = lockable;
		this.lockMode = lockMode;
		// ForceIncrement can be used for PESSIMISTIC_READ, PESSIMISTIC_WRITE or PESSIMISTIC_FORCE_INCREMENT 
		if ( lockMode.lessThan( LockMode.PESSIMISTIC_READ ) ) {
			throw new HibernateException( "[" + lockMode + "] not valid for [" + lockable.getEntityName() + "]" );
		} 
	} 
 
	/** 
	 * {@inheritDoc} 
	 */ 
	public void lock( 
			Serializable id,
			Object version, 
			Object object, 
			int timeout,
			SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
5
CodeRank
This code example shows how to use the following methods:lessThan
	 * @param lockable The metadata for the entity to be locked. 
	 * @param lockMode Indictates the type of lock to be acquired. 
	 */ 
	public OptimisticLockingStrategy(Lockable lockable, LockMode lockMode) {
		this.lockable = lockable;
		this.lockMode = lockMode;
		if ( lockMode.lessThan( LockMode.OPTIMISTIC ) ) {
			throw new HibernateException( "[" + lockMode + "] not valid for [" + lockable.getEntityName() + "]" );
		} 
	} 
 
   /** 
	 * @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() ) {
5
CodeRank
lessThan Method Overview
Check if this lock mode is less restrictive than the given lock mode.
See Code Examples for other Hibernate ORM LockMode Methods: