Hibernate ORM LockOptions - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM LockOptions class.

This code example shows how to use the following methods:setAliasSpecificLockMode
	@Override 
	public Query setLockMode(String alias, LockMode lockMode) {
		org.hibernate.LockMode hibernateLockMode = LockModeTranslator.translate(
			lockMode);
 
		LockOptions lockOptions = new LockOptions(hibernateLockMode);
 
		lockOptions.setAliasSpecificLockMode(alias, hibernateLockMode);
 
		_query.setLockOptions(lockOptions);
 
		return this;
	} 
 
	@Override 
	public Query setLong(int pos, long value) {
		_query.setLong(pos, value);
 
		return this;
	} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLockMode, getScope, getTimeOut
	 
	public Query setLockOptions(LockOptions lockOption) {
		this.lockOptions.setLockMode(lockOption.getLockMode());
		this.lockOptions.setScope(lockOption.getScope());
		this.lockOptions.setTimeOut(lockOption.getTimeOut());
		return this;
	} 
 
	public LockOptions getLockOptions() {
		return lockOptions;
	} 
 
} 
 
 
 
 
 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLockMode, setLockMode
 
	public void setEntityId(Serializable entityId) {
		this.entityId = entityId;
	} 
 
	public String getEntityClassName() {
		return entityClassName;
	} 
 
	public void setEntityClassName(String entityClassName) {
		this.entityClassName = entityClassName;
	} 
 
	public Object getInstanceToLoad() { 
		return instanceToLoad; 
	} 
 
	public void setInstanceToLoad(Object instanceToLoad) { 
		this.instanceToLoad = instanceToLoad;
	} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLockMode
public class RefreshEvent extends AbstractEvent {
 
	private Object object; 
	private String entityName;
 
	private LockOptions lockOptions = new LockOptions().setLockMode(LockMode.READ);
 
	public RefreshEvent(Object object, EventSource source) {
		super(source);
		if (object == null) { 
			throw new IllegalArgumentException("Attempt to generate refresh event with null object");
		} 
		this.object = object;
	} 
 
	public RefreshEvent(String entityName, Object object, EventSource source){
		this(object, source);
		this.entityName = entityName;
	} 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLockMode
	} 
 
	public LockEvent(Object object, LockMode lockMode, EventSource source) {
		super(source);
		this.object = object;
		this.lockOptions = new LockOptions().setLockMode(lockMode);
	} 
 
	public LockEvent(Object object, LockOptions lockOptions, EventSource source) {
		super(source);
		this.object = object;
		this.lockOptions = lockOptions;
	} 
 
	public Object getObject() { 
		return object; 
	} 
 
	public void setObject(Object object) { 
		this.object = object;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLockMode, getTimeOut
		batchLoader = batchSize > 1; 
 
        LOG.debugf("Static select for entity %s [%s:%s]: %s", 
                   entityName, 
                   lockOptions.getLockMode(), 
                   lockOptions.getTimeOut(), 
                   getSQLString()); 
	} 
 
	public Object loadByUniqueKey(SessionImplementor session,Object key) { 
		return load( session, key, null, null, LockOptions.NONE ); 
	} 
 
	@Override 
    protected boolean isSingleRowLoader() { 
		return !batchLoader; 
	} 
 
	@Override 
    public int[][] getCompositeKeyManyToOneTargetIndices() { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLockMode, getTimeOut
		 
		if ( StringHelper.isNotEmpty(orderByClause) ) {
			buf.append(" order by ").append(orderByClause);
		} 
		 
		if (lockOptions.getLockMode()!=LockMode.NONE) {
			buf.append( dialect.getForUpdateString(lockOptions) );
		} 
		 
		return dialect.transformSelectString( buf.toString() );
	} 
 
	/** 
	 * Sets the fromClause. 
	 * @param fromClause The fromClause to set 
	 */ 
	public Select setFromClause(String fromClause) {
		this.fromClause = fromClause;
		this.guesstimatedBufferSize += fromClause.length();
		return this;

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLockMode
	 * @param lockMode The {@link LockMode} used for this query. 
	 * @return this object 
	 * @deprecated Instead use setLockOptions 
	 */ 
    public AuditQuery setLockMode(LockMode lockMode) {
        lockOptions.setLockMode(lockMode);
        return this;
    } 
 
	/** 
	 * Set lock options 
	 * @param lockOptions The @{link LockOptions} used for this query. 
	 * @return this object 
	 */ 
	public AuditQuery setLockOptions(LockOptions lockOptions) {
		LockOptions.copy(lockOptions, this.lockOptions);
		return this;
	} 
    protected void setQueryProperties(Query query) {
        if (maxResults != null) query.setMaxResults(maxResults);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLockMode
		return this;
	} 
 
	public SimpleSelect setLockMode(LockMode lockMode) {
		this.lockOptions.setLockMode( lockMode );
		return this;
	} 
 
	public SimpleSelect addWhereToken(String token) {
		whereTokens.add(token);
		return this;
	} 
	 
	private void and() { 
		if ( whereTokens.size()>0 ) {
			whereTokens.add("and");
		} 
	} 
 
	public SimpleSelect addCondition(String lhs, String op, String rhs) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Hibernate ORM LockOptions Methods: