當前位置: 首頁>>代碼示例>>Java>>正文


Java Propagation.REQUIRED屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:20,代碼來源:TermServiceImpl.java

示例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;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:19,代碼來源:AbstractCopyrightService.java

示例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)));
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:17,代碼來源:TLEGroupServiceImpl.java

示例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);
   }
}
 
開發者ID:SentinelDataHub,項目名稱:dhus-core,代碼行數:14,代碼來源:UserService.java

示例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;
}
 
開發者ID:SentinelDataHub,項目名稱:dhus-core,代碼行數:13,代碼來源:UserService.java

示例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);
}
 
開發者ID:SentinelDataHub,項目名稱:dhus-core,代碼行數:11,代碼來源:UserService.java

示例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();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:30,代碼來源:TLEGroupServiceImpl.java

示例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;
}
 
開發者ID:SentinelDataHub,項目名稱:dhus-core,代碼行數:12,代碼來源:UserService.java

示例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;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:20,代碼來源:VcfManager.java

示例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);
}
 
開發者ID:SentinelDataHub,項目名稱:dhus-core,代碼行數:7,代碼來源:ProductService.java

示例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;
    }
}
 
開發者ID:penggle,項目名稱:xproject,代碼行數:12,代碼來源:AdminUserServiceImpl.java

示例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);
}
 
開發者ID:babymm,項目名稱:mmsns,代碼行數:15,代碼來源:MMSnsActionCollectServiceImpl.java

示例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;
}
 
開發者ID:yunjiweidian,項目名稱:TITAN,代碼行數:19,代碼來源:SceneServiceImpl.java

示例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());
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:10,代碼來源:ChromosomeReferenceSequenceTest.java

示例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;
}
 
開發者ID:PekingGo,項目名稱:ipayquery,代碼行數:12,代碼來源:UserRoleServiceImpl.java


注:本文中的org.springframework.transaction.annotation.Propagation.REQUIRED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。