类org.hibernate.persister.entity.Lockable源码实例Demo

下面列出了怎么用org.hibernate.persister.entity.Lockable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: HSQLDialect.java
/**
 * For HSQLDB 2.0, this is a copy of the base class implementation.
 * For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
 * <p/>
 * {@inheritDoc}
 */
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
		return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
		return new PessimisticReadSelectLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC ) {
		return new OptimisticLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
	}

	if ( hsqldbVersion < 200 ) {
		return new ReadUncommittedLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码2 项目: lams   文件: Cache71Dialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// InterSystems Cache' does not current support "SELECT ... FOR UPDATE" syntax...
	// Set your transaction mode to READ_COMMITTED before using
	if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_READ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC) {
		return new OptimisticLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码3 项目: lams   文件: TimesTenDialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// TimesTen has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC ) {
		return new OptimisticLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码4 项目: lams   文件: PointbaseDialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Pointbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_READ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC) {
		return new OptimisticLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码5 项目: lams   文件: RDMSOS2200Dialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// RDMS has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC ) {
		return new OptimisticLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码6 项目: lams   文件: MckoiDialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_READ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC) {
		return new OptimisticLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码7 项目: lams   文件: Dialect.java
/**
 * Get a strategy instance which knows how to acquire a database-level lock
 * of the specified mode for this dialect.
 *
 * @param lockable The persister for the entity to be locked.
 * @param lockMode The type of lock to be acquired.
 * @return The appropriate locking strategy.
 * @since 3.2
 */
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	switch ( lockMode ) {
		case PESSIMISTIC_FORCE_INCREMENT:
			return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
		case PESSIMISTIC_WRITE:
			return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );
		case PESSIMISTIC_READ:
			return new PessimisticReadSelectLockingStrategy( lockable, lockMode );
		case OPTIMISTIC:
			return new OptimisticLockingStrategy( lockable, lockMode );
		case OPTIMISTIC_FORCE_INCREMENT:
			return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
		default:
			return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码8 项目: lams   文件: FrontBaseDialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Frontbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode==LockMode.PESSIMISTIC_FORCE_INCREMENT) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_WRITE) {
		return new PessimisticWriteUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.PESSIMISTIC_READ) {
		return new PessimisticReadUpdateLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC) {
		return new OptimisticLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode==LockMode.OPTIMISTIC_FORCE_INCREMENT) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode);
	}
	else if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码9 项目: hibernate-ogm-ignite   文件: IgniteDialect.java
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
		return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	// else if ( lockMode==LockMode.PESSIMISTIC_WRITE ) {
	// return new PessimisticWriteLockingStrategy( lockable, lockMode );
	// }
	else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
		return new IgnitePessimisticReadLockingStrategy( lockable, lockMode, provider );
	}
	else if ( lockMode == LockMode.OPTIMISTIC ) {
		return new OptimisticLockingStrategy( lockable, lockMode );
	}
	else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
		return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
	}
	else {
		return null;
	}
}
 
源代码10 项目: cacheonix-core   文件: CriteriaLoader.java
protected String applyLocks(String sqlSelectString, Map lockModes, Dialect dialect) throws QueryException {
	if ( lockModes == null || lockModes.isEmpty() ) {
		return sqlSelectString;
	}

	final Map aliasedLockModes = new HashMap();
	final Map keyColumnNames = dialect.forUpdateOfColumns() ? new HashMap() : null;
	final String[] drivingSqlAliases = getAliases();
	for ( int i = 0; i < drivingSqlAliases.length; i++ ) {
		final LockMode lockMode = ( LockMode ) lockModes.get( drivingSqlAliases[i] );
		if ( lockMode != null ) {
			final Lockable drivingPersister = ( Lockable ) getEntityPersisters()[i];
			final String rootSqlAlias = drivingPersister.getRootTableAlias( drivingSqlAliases[i] );
			aliasedLockModes.put( rootSqlAlias, lockMode );
			if ( keyColumnNames != null ) {
				keyColumnNames.put( rootSqlAlias, drivingPersister.getRootTableIdentifierColumnNames() );
			}
		}
	}
	return dialect.applyLocksToSql( sqlSelectString, aliasedLockModes, keyColumnNames );
}
 
源代码11 项目: lams   文件: UpdateLockingStrategy.java
/**
 * Construct a locking strategy based on SQL UPDATE statements.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indictates the type of lock to be acquired.  Note that
 * read-locks are not valid for this strategy.
 */
public UpdateLockingStrategy(Lockable lockable, LockMode lockMode) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	if ( lockMode.lessThan( LockMode.UPGRADE ) ) {
		throw new HibernateException( "[" + lockMode + "] not valid for update statement" );
	}
	if ( !lockable.isVersioned() ) {
		LOG.writeLocksNotSupported( lockable.getEntityName() );
		this.sql = null;
	}
	else {
		this.sql = generateLockString();
	}
}
 
源代码12 项目: lams   文件: OptimisticLockingStrategy.java
/**
 * Construct locking strategy.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indicates 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() + "]" );
	}
}
 
/**
 * Construct locking strategy.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indicates the type of lock to be acquired.
 */
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() + "]" );
	}
}
 
/**
 * Construct a locking strategy based on SQL UPDATE statements.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indicates the type of lock to be acquired.  Note that read-locks are not valid for this strategy.
 */
public PessimisticWriteUpdateLockingStrategy(Lockable lockable, LockMode lockMode) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	if ( lockMode.lessThan( LockMode.PESSIMISTIC_READ ) ) {
		throw new HibernateException( "[" + lockMode + "] not valid for update statement" );
	}
	if ( !lockable.isVersioned() ) {
		LOG.writeLocksNotSupported( lockable.getEntityName() );
		this.sql = null;
	}
	else {
		this.sql = generateLockString();
	}
}
 
/**
 * Construct locking strategy.
 *
 * @param lockable The metadata for the entity to be locked.
 * @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() + "]" );
	}
}
 
/**
 * Construct a locking strategy based on SQL UPDATE statements.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indicates the type of lock to be acquired.  Note that
 * read-locks are not valid for this strategy.
 */
public PessimisticReadUpdateLockingStrategy(Lockable lockable, LockMode lockMode) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	if ( lockMode.lessThan( LockMode.PESSIMISTIC_READ ) ) {
		throw new HibernateException( "[" + lockMode + "] not valid for update statement" );
	}
	if ( !lockable.isVersioned() ) {
		LOG.writeLocksNotSupported( lockable.getEntityName() );
		this.sql = null;
	}
	else {
		this.sql = generateLockString();
	}
}
 
源代码17 项目: cacheonix-core   文件: QueryLoader.java
protected String applyLocks(String sql, Map lockModes, Dialect dialect) throws QueryException {
	if ( lockModes == null || lockModes.size() == 0 ) {
		return sql;
	}

	// can't cache this stuff either (per-invocation)
	// we are given a map of user-alias -> lock mode
	// create a new map of sql-alias -> lock mode
	final Map aliasedLockModes = new HashMap();
	final Map keyColumnNames = dialect.forUpdateOfColumns() ? new HashMap() : null;
	final Iterator iter = lockModes.entrySet().iterator();
	while ( iter.hasNext() ) {
		Map.Entry me = ( Map.Entry ) iter.next();
		final String userAlias = ( String ) me.getKey();
		final String drivingSqlAlias = ( String ) sqlAliasByEntityAlias.get( userAlias );
		if ( drivingSqlAlias == null ) {
			throw new IllegalArgumentException( "could not locate alias to apply lock mode : " + userAlias );
		}
		// at this point we have (drivingSqlAlias) the SQL alias of the driving table
		// corresponding to the given user alias.  However, the driving table is not
		// (necessarily) the table against which we want to apply locks.  Mainly,
		// the exception case here is joined-subclass hierarchies where we instead
		// want to apply the lock against the root table (for all other strategies,
		// it just happens that driving and root are the same).
		final QueryNode select = ( QueryNode ) queryTranslator.getSqlAST();
		final Lockable drivingPersister = ( Lockable ) select.getFromClause().getFromElement( userAlias ).getQueryable();
		final String sqlAlias = drivingPersister.getRootTableAlias( drivingSqlAlias );
		aliasedLockModes.put( sqlAlias, me.getValue() );
		if ( keyColumnNames != null ) {
			keyColumnNames.put( sqlAlias, drivingPersister.getRootTableIdentifierColumnNames() );
		}
	}
	return dialect.applyLocksToSql( sql, aliasedLockModes, keyColumnNames );
}
 
源代码18 项目: cacheonix-core   文件: Cache71Dialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// InterSystems Cache' does not current support "SELECT ... FOR UPDATE" syntax...
	// Set your transaction mode to READ_COMMITTED before using
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码19 项目: cacheonix-core   文件: TimesTenDialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// TimesTen has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码20 项目: cacheonix-core   文件: PointbaseDialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Pointbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码21 项目: cacheonix-core   文件: UpdateLockingStrategy.java
/**
 * Construct a locking strategy based on SQL UPDATE statements.
 *
 * @param lockable The metadata for the entity to be locked.
 * @param lockMode Indictates the type of lock to be acquired.  Note that
 * read-locks are not valid for this strategy.
 */
public UpdateLockingStrategy(Lockable lockable, LockMode lockMode) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	if ( lockMode.lessThan( LockMode.UPGRADE ) ) {
		throw new HibernateException( "[" + lockMode + "] not valid for update statement" );
	}
	if ( !lockable.isVersioned() ) {
		log.warn( "write locks via update not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		this.sql = null;
	}
	else {
		this.sql = generateLockString();
	}
}
 
源代码22 项目: cacheonix-core   文件: RDMSOS2200Dialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// RDMS has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码23 项目: cacheonix-core   文件: MckoiDialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
源代码24 项目: cacheonix-core   文件: FrontBaseDialect.java
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
	// Frontbase has no known variation of a "SELECT ... FOR UPDATE" syntax...
	if ( lockMode.greaterThan( LockMode.READ ) ) {
		return new UpdateLockingStrategy( lockable, lockMode );
	}
	else {
		return new SelectLockingStrategy( lockable, lockMode );
	}
}
 
@Override
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
  return LOCKING_STRATEGY;
}
 
源代码26 项目: lams   文件: QueryLoader.java
@Override
protected String applyLocks(
		String sql,
		QueryParameters parameters,
		Dialect dialect,
		List<AfterLoadAction> afterLoadActions) throws QueryException {
	// can't cache this stuff either (per-invocation)
	// we are given a map of user-alias -> lock mode
	// create a new map of sql-alias -> lock mode

	final LockOptions lockOptions = parameters.getLockOptions();

	if ( lockOptions == null ||
			( lockOptions.getLockMode() == LockMode.NONE && lockOptions.getAliasLockCount() == 0 ) ) {
		return sql;
	}


	// user is request locking, lets see if we can apply locking directly to the SQL...

	// 		some dialects wont allow locking with paging...
	if ( shouldUseFollowOnLocking( parameters, dialect, afterLoadActions ) ) {
		return sql;
	}

	//		there are other conditions we might want to add here, such as checking the result types etc
	//		but those are better served after we have redone the SQL generation to use ASTs.


	// we need both the set of locks and the columns to reference in locks
	// as the ultimate output of this section...
	final LockOptions locks = new LockOptions( lockOptions.getLockMode() );
	final Map<String, String[]> keyColumnNames = dialect.forUpdateOfColumns()
			? new HashMap<>()
			: null;

	locks.setScope( lockOptions.getScope() );
	locks.setTimeOut( lockOptions.getTimeOut() );

	for ( Map.Entry<String, String> entry : sqlAliasByEntityAlias.entrySet() ) {
		final String userAlias = entry.getKey();
		final String drivingSqlAlias = entry.getValue();
		if ( drivingSqlAlias == null ) {
			throw new IllegalArgumentException( "could not locate alias to apply lock mode : " + userAlias );
		}
		// at this point we have (drivingSqlAlias) the SQL alias of the driving table
		// corresponding to the given user alias.  However, the driving table is not
		// (necessarily) the table against which we want to apply locks.  Mainly,
		// the exception case here is joined-subclass hierarchies where we instead
		// want to apply the lock against the root table (for all other strategies,
		// it just happens that driving and root are the same).
		final QueryNode select = (QueryNode) queryTranslator.getSqlAST();
		final Lockable drivingPersister = (Lockable) select.getFromClause()
				.findFromElementByUserOrSqlAlias( userAlias, drivingSqlAlias )
				.getQueryable();
		final String sqlAlias = drivingPersister.getRootTableAlias( drivingSqlAlias );

		final LockMode effectiveLockMode = lockOptions.getEffectiveLockMode( userAlias );
		locks.setAliasSpecificLockMode( sqlAlias, effectiveLockMode );

		if ( keyColumnNames != null ) {
			keyColumnNames.put( sqlAlias, drivingPersister.getRootTableIdentifierColumnNames() );
		}
	}

	// apply the collected locks and columns
	return dialect.applyLocksToSql( sql, locks, keyColumnNames );
}
 
源代码27 项目: lams   文件: HSQLDialect.java
public ReadUncommittedLockingStrategy(Lockable lockable, LockMode lockMode) {
	super( lockable, lockMode );
}
 
源代码28 项目: lams   文件: AbstractSelectLockingStrategy.java
protected AbstractSelectLockingStrategy(Lockable lockable, LockMode lockMode) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	this.waitForeverSql = generateLockString( LockOptions.WAIT_FOREVER );
}
 
源代码29 项目: lams   文件: AbstractSelectLockingStrategy.java
protected Lockable getLockable() {
	return lockable;
}
 
public IgnitePessimisticReadLockingStrategy(Lockable lockable, LockMode lockMode, IgniteDatastoreProvider provider) {
	this.lockable = lockable;
	this.lockMode = lockMode;
	this.provider = provider;
	// this.provider = getProvider(lockable.getFactory());
}
 
 类所在包
 类方法
 同包方法