当前位置: 首页>>代码示例>>Java>>正文


Java LockModeType.PESSIMISTIC_WRITE属性代码示例

本文整理汇总了Java中javax.persistence.LockModeType.PESSIMISTIC_WRITE属性的典型用法代码示例。如果您正苦于以下问题:Java LockModeType.PESSIMISTIC_WRITE属性的具体用法?Java LockModeType.PESSIMISTIC_WRITE怎么用?Java LockModeType.PESSIMISTIC_WRITE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.persistence.LockModeType的用法示例。


在下文中一共展示了LockModeType.PESSIMISTIC_WRITE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertToLockModeType

/**
 * Convert from the Hibernate specific LockMode to the JPA defined LockModeType.
 *
 * @param lockMode The Hibernate LockMode.
 *
 * @return The JPA LockModeType
 */
public static LockModeType convertToLockModeType(LockMode lockMode) {
	if ( lockMode == LockMode.NONE ) {
		return LockModeType.NONE;
	}
	else if ( lockMode == LockMode.OPTIMISTIC || lockMode == LockMode.READ ) {
		return LockModeType.OPTIMISTIC;
	}
	else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT || lockMode == LockMode.WRITE ) {
		return LockModeType.OPTIMISTIC_FORCE_INCREMENT;
	}
	else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
		return LockModeType.PESSIMISTIC_READ;
	}
	else if ( lockMode == LockMode.PESSIMISTIC_WRITE
			|| lockMode == LockMode.UPGRADE
			|| lockMode == LockMode.UPGRADE_NOWAIT
               || lockMode == LockMode.UPGRADE_SKIPLOCKED) {
		return LockModeType.PESSIMISTIC_WRITE;
	}
	else if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT
			|| lockMode == LockMode.FORCE ) {
		return LockModeType.PESSIMISTIC_FORCE_INCREMENT;
	}
	throw new AssertionFailure( "unhandled lock mode " + lockMode );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:LockModeConverter.java

示例2: lock

/**
 * 使用悲观锁
 */
public void lock() {
	this.lockMode = LockModeType.PESSIMISTIC_WRITE;
}
 
开发者ID:szsucok,项目名称:sucok-framework,代码行数:6,代码来源:BaseQueryForm.java

示例3: listByState

@Lock(LockModeType.PESSIMISTIC_WRITE)
@Query("SELECT p FROM AitTaskEmailPivot p WHERE p.state = ?1 order by p.id")
List<AitTaskEmailPivot> listByState(final String state);
 
开发者ID:allianzit,项目名称:ait-platform,代码行数:3,代码来源:IAitTaskEmailPivotRepo.java

示例4: findLockByAppCodeAndKeyAndProfileCode

@Lock(LockModeType.PESSIMISTIC_WRITE)
PropertyValue findLockByAppCodeAndKeyAndProfileCode(String appCode, String key, String profileCode);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:PropertyValueDao.java

示例5: findLockByAppCode

@Lock(LockModeType.PESSIMISTIC_WRITE)
App findLockByAppCode(String appCode);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:AppDao.java

示例6: findLockByProfileCode

@Lock(LockModeType.PESSIMISTIC_WRITE)
Profile findLockByProfileCode(String profileCode);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:ProfileDao.java

示例7: findLockByAppCodeAndKey

@Lock(LockModeType.PESSIMISTIC_WRITE)
PropertyKey findLockByAppCodeAndKey(String appCode, String key);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:PropertyKeyDao.java

示例8: findLockByManagerCode

@Lock(LockModeType.PESSIMISTIC_WRITE)
Manager findLockByManagerCode(String managerCode);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:ManagerDao.java

示例9: findLockByManagerCodeAndAppCode

@Lock(LockModeType.PESSIMISTIC_WRITE)
ManagerApp findLockByManagerCodeAndAppCode(String managerCode, String appCode);
 
开发者ID:zhongxunking,项目名称:configcenter,代码行数:2,代码来源:ManagerAppDao.java

示例10: findOneForUpdate

/**
 * Zoek een gepersisteerde {@link Selectietaak selectietaak} voor een update.
 * @param id het ID van de taak
 * @return de selectietaak
 */
@Query("select t from Selectietaak t where id= :id")
@Lock(LockModeType.PESSIMISTIC_WRITE)
Selectietaak findOneForUpdate(@Param("id") Integer id);
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:8,代码来源:SelectieTaakJpaRepository.java


注:本文中的javax.persistence.LockModeType.PESSIMISTIC_WRITE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。