本文整理汇总了Java中org.springframework.transaction.annotation.Propagation.REQUIRED属性的典型用法代码示例。如果您正苦于以下问题:Java Propagation.REQUIRED属性的具体用法?Java Propagation.REQUIRED怎么用?Java Propagation.REQUIRED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.transaction.annotation.Propagation
的用法示例。
在下文中一共展示了Propagation.REQUIRED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertTerm
@Override
@SecureOnCall(priv = "EDIT_TAXONOMY")
@Transactional(propagation = Propagation.REQUIRED)
public TermResult insertTerm(Taxonomy taxonomy, TermResult parentTermResult, String termValue, int index)
{
Term parentTerm = null;
if( parentTermResult != null )
{
parentTerm = getTermByUuid(taxonomy, parentTermResult.getUuid());
}
String parentFullpath = null;
if( parentTerm != null )
{
parentFullpath = parentTerm.getFullValue();
}
String termFullValue = insertTermImpl(taxonomy, parentFullpath, termValue, index, false);
return this.getTermResult(taxonomy, termFullValue);
}
示例2: getPortionsForItems
@Override
@Transactional(propagation = Propagation.REQUIRED)
public Map<Long, List<P>> getPortionsForItems(List<Item> items)
{
Map<Long, List<P>> portionMap = new HashMap<Long, List<P>>();
List<P> portions = dao.getPortionsForItems(items);
for( P portion : portions )
{
long itemId = portion.getItem().getId();
List<P> portionList = portionMap.get(itemId);
if( portionList == null )
{
portionList = new ArrayList<P>();
portionMap.put(itemId, portionList);
}
portionList.add(portion);
}
return portionMap;
}
示例3: userIdChangedEvent
@Override
@Transactional(propagation = Propagation.REQUIRED)
public void userIdChangedEvent(UserIdChangedEvent event)
{
String fromUserId = event.getFromUserId();
for( TLEGroup group : dao.getGroupsContainingUser(fromUserId) )
{
Set<String> users = group.getUsers();
users.remove(fromUserId);
users.add(event.getToUserId());
dao.update(group);
eventService
.publishApplicationEvent(new GroupEditEvent(group.getUuid(), Collections.singleton(fromUserId)));
}
}
示例4: addAccessToCollections
@PreAuthorize ("hasRole('ROLE_DATA_MANAGER')")
@Transactional (readOnly=false, propagation=Propagation.REQUIRED)
public void addAccessToCollections (String user_uuid, List<String> collection_uuids)
throws RootNotModifiableException
{
User user = userDao.read (user_uuid);
checkRoot (user);
// database
for (String collectionUUID : collection_uuids)
{
Collection collection = collectionDao.read (collectionUUID);
userDao.addAccessToCollection (user, collection);
}
}
示例5: getUserWelcome
@Transactional (readOnly=true, propagation=Propagation.REQUIRED)
private String getUserWelcome (User u)
{
String firstname = u.getUsername ();
String lastname = "";
if (u.getFirstname () != null && !u.getFirstname().trim ().isEmpty ())
{
firstname = u.getFirstname ();
if (u.getLastname () != null && !u.getLastname().trim ().isEmpty ())
lastname = " " + u.getLastname ();
}
return firstname + lastname;
}
示例6: clearSavedSearches
@PreAuthorize ("hasRole('ROLE_SEARCH')")
@Transactional (readOnly=false, propagation=Propagation.REQUIRED)
public void clearSavedSearches (String uuid)
{
User u = userDao.read (uuid);
if (u == null)
{
throw new UserNotExistingException ();
}
userDao.clearUserSearches(u);
}
示例7: edit
@Override
@RequiresPrivilege(priv = "EDIT_USER_MANAGEMENT")
@Transactional(propagation = Propagation.REQUIRED)
public String edit(final TLEGroup group)
{
boolean parentSame;
{
TLEGroup original = get(group.getUuid());
TLEGroup oldParent = original.getParent();
dao.unlinkFromSession(original);
dao.unlinkFromSession(oldParent);
parentSame = Objects.equals(oldParent, group.getParent());
}
group.setInstitution(CurrentInstitution.get());
validate(group);
checkInUse(group, false);
dao.update(group);
if( !parentSame )
{
LOGGER.info("Group parent modified - Rebuilding subgroup parents");
updateGroup(group);
}
eventService.publishApplicationEvent(new GroupEditEvent(group.getUuid(), group.getUsers()));
return group.getUuid();
}
示例8: countUserSearches
@PreAuthorize ("hasRole('ROLE_SEARCH')")
@Transactional (readOnly=true, propagation=Propagation.REQUIRED)
public int countUserSearches (String uuid)
{
User u = userDao.read (uuid);
if (u == null)
{
throw new UserNotExistingException ();
}
List<Search> searches = userDao.getUserSearches(u);
return searches != null ? searches.size () : 0;
}
示例9: unregisterVcfFile
/**
* Delete vcf file metadata from database and feature file directory.
*
* @param vcfFileId id of file to remove
* @return deleted file
* @throws IOException if error occurred during deleting feature file directory
*/
@Transactional(propagation = Propagation.REQUIRED)
public VcfFile unregisterVcfFile(final Long vcfFileId) throws IOException {
Assert.notNull(vcfFileId, MessagesConstants.ERROR_INVALID_PARAM);
Assert.isTrue(vcfFileId > 0, MessagesConstants.ERROR_INVALID_PARAM);
VcfFile vcfFile = vcfFileManager.loadVcfFile(vcfFileId);
Assert.notNull(vcfFile, MessagesConstants.ERROR_NO_SUCH_FILE);
vcfFileManager.deleteVcfFile(vcfFile);
if (vcfFile.getType() == BiologicalDataItemResourceType.GA4GH) {
return vcfFile;
}
fileManager.deleteFeatureFileDirectory(vcfFile);
return vcfFile;
}
示例10: count
@PreAuthorize ("hasAnyRole('ROLE_DATA_MANAGER','ROLE_SEARCH')")
@Transactional (readOnly = true, propagation = Propagation.REQUIRED)
@Cacheable (value = "product_count", key = "{#filter, null}")
public Integer count(String filter)
{
return productDao.count(filter, null);
}
示例11: createUser
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public void createUser(AdminUser user) {
ValidationAssert.notNull(user, "参数不能为空!");
try {
user.setEncryptedPassword(UserPasswdUtils.encryptPassword(user.getPassword(), user.getPasswordSalt(), GlobalConstants.DEFAULT_PASSWORD_HASH_ITERATIONS));
adminUserMapper.insertUser(user);
}
catch (DuplicateKeyException e) {
BusinessAssert.isTrue(!e.getCause().getMessage().toUpperCase().contains("USER_NAME"), "对不起,该用户名已存在!");
throw e;
}
}
示例12: cancelActionCollect
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void cancelActionCollect(MMSnsActionCollectEntity actionCollectEntity) {
//删除动弹收藏信息
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("actionId", actionCollectEntity.getActionId());
paramMap.put("collectUserId", actionCollectEntity.getCollectUserId());
actionCollectDao.delete(paramMap);
//收藏-1
MMSnsActionEntity actionEntity = new MMSnsActionEntity();
actionEntity.setActionId(actionCollectEntity.getActionId());
actionEntity.setCollectCount(1);
actionService.updateAction(actionEntity);
}
示例13: removeSceneAndUpdateRelatedData
/**
* @desc 删除场景并更新相关连数据
*
* @author liuliang
*
* @param sceneId
* @return
*/
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, isolation = Isolation.DEFAULT, timeout = 5)
public int removeSceneAndUpdateRelatedData(long sceneId) throws Exception {
//1、删场景
int result = sceneDao.removeScene(String.valueOf(sceneId));
//2、删定时任务
automaticTaskDao.delBySceneId(sceneId);
//3、删监控集
monitorSetDao.delBySceneId(sceneId);
return result;
}
示例14: getSequenceInterval
@Test
@Transactional(propagation = Propagation.REQUIRED)
public void getSequenceInterval() throws Exception {
ChromosomeReferenceSequence referenceSequence = new ChromosomeReferenceSequence(chromosomes,
referenceId, referenceManager);
ReferenceSequence sequence =
referenceSequence.getSubsequenceAt(CHR_1, INTERVAL_START, INTERVAL_END);
Assert.assertEquals(EXPECTED_SEQUENCES.get(CHR_1).substring(INTERVAL_START - 1, INTERVAL_END),
sequence.getBaseString());
}
示例15: getUAccount
/**
* 通过角色id得到用户帐号
*
* @return
*
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public String getUAccount(String xzrl) {
String uAccount = userRoleDao.getUAccount(xzrl);
return uAccount;
}