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


Java DocumentLink類代碼示例

本文整理匯總了Java中org.kuali.rice.kew.documentlink.DocumentLink的典型用法代碼示例。如果您正苦於以下問題:Java DocumentLink類的具體用法?Java DocumentLink怎麽用?Java DocumentLink使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DocumentLink類屬於org.kuali.rice.kew.documentlink包,在下文中一共展示了DocumentLink類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveDocumentLink

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
/**
	 * add double link
	 * 
	 * @see org.kuali.rice.kew.documentlink.dao.DocumentLinkDAO#saveDocumentLink(org.kuali.rice.kew.documentlink.DocumentLink)
	 */
	public void saveDocumentLink(DocumentLink link) {
		DocumentLink linkedDocument = getLinkedDocument(link);
		if(linkedDocument == null) {
			if (link.getDocLinkId() == null) {
				entityManager.persist(link);
			} else {
				OrmUtils.merge(entityManager, link);
			}
		} else {
			link.setDocLinkId(linkedDocument.getDocLinkId());
		}
//		//if we want a 2-way linked pair
		DocumentLink rLink = DocumentLinkDaoUtil.reverseLink((DocumentLink)ObjectUtils.deepCopy(link));
		if(getLinkedDocument(rLink) == null) {
			if (link.getDocLinkId() == null) {
				entityManager.persist(rLink);
			} else {
				OrmUtils.merge(entityManager, rLink);
			}
		}

	}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:28,代碼來源:DocumentLinkDAOJpaImpl.java

示例2: deleteDocumentLink

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
@Override
public void deleteDocumentLink(DocumentLink link) {
    getDataObjectService().delete(link);
    // see if a reverse link exists or not
    DocumentLink reverseLink = getLinkedDocument(link.getDestDocId(), link.getOrgnDocId());
    if (reverseLink != null) {
        getDataObjectService().delete(reverseLink);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:10,代碼來源:DocumentLinkDAOJpa.java

示例3: getLinkedDocumentsByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
@Override
public List<DocumentLink> getLinkedDocumentsByDocId(String docId) {
    TypedQuery<DocumentLink> query =
            getEntityManager().createNamedQuery("DocumentLink.GetLinkedDocumentsByDocId", DocumentLink.class);
    query.setParameter("orgnDocId",docId);
    return query.getResultList();

}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:DocumentLinkDAOJpa.java

示例4: getOutgoingLinkedDocumentsByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
@Override
public List<DocumentLink> getOutgoingLinkedDocumentsByDocId(String docId) {
    TypedQuery<DocumentLink> query =
            getEntityManager().createNamedQuery("DocumentLink.GetOutgoingLinkedDocumentsByDocId", DocumentLink.class);
    query.setParameter("destDocId",docId);
    return query.getResultList();
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:8,代碼來源:DocumentLinkDAOJpa.java

示例5: saveDocumentLink

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
@Override
public DocumentLink saveDocumentLink(DocumentLink link) {
    link = saveIfNotExists(link);
    // create the 2-way linked pair
    saveIfNotExists(createReverseLink(link));
    getDataObjectService().flush(DocumentLink.class);
    return link;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:DocumentLinkDAOJpa.java

示例6: saveIfNotExists

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
protected DocumentLink saveIfNotExists(DocumentLink link) {
    // if an existing link already exists for this, we pretty much just ignore the request to save since it's
    // already there
    DocumentLink existingLink = getLinkedDocument(link.getOrgnDocId(), link.getDestDocId());
    if (existingLink == null) {
        link = getDataObjectService().save(link);
    } else {
        link = existingLink;
    }
    return link;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:12,代碼來源:DocumentLinkDAOJpa.java

示例7: getLinkedDocument

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
protected DocumentLink getLinkedDocument(String orgnDocId, String destDocId) {
    TypedQuery<DocumentLink> query =
            getEntityManager().createNamedQuery("DocumentLink.GetLinkedDocument", DocumentLink.class);
    query.setParameter("orgnDocId", orgnDocId);
    query.setParameter("destDocId", destDocId);
    try {
        return query.getSingleResult();
    } catch (NoResultException e) {
        return null;
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:12,代碼來源:DocumentLinkDAOJpa.java

示例8: testDocumentLink

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
@Test
public void testDocumentLink() throws Exception{
    DocumentLink documentLink = setupDocumentLink(TEST_DOC_ID,"9999");
    assertTrue("documentlink persisted correctly", documentLink != null &&
                StringUtils.isNotBlank(documentLink.getDocLinkId()));
    KEWServiceLocator.getDocumentLinkService().deleteDocumentLink(documentLink);
    documentLink = KRADServiceLocator.getDataObjectService().find(DocumentLink.class,documentLink.getDocLinkId());
    assertTrue("documentlink was deleted",documentLink == null);

}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:11,代碼來源:KewDocumentDataJpaTest.java

示例9: saveDocumentLink

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
public void saveDocumentLink(DocumentLink link) {
	DocumentLink linkedDocument = getLinkedDocument(link);
	if(linkedDocument == null)
		this.getPersistenceBrokerTemplate().store(link);
	else
		link.setDocLinkId(linkedDocument.getDocLinkId());
	//if we want a 2-way linked pair
	DocumentLink rLink = DocumentLinkDaoUtil.reverseLink(link);
	if(getLinkedDocument(rLink) == null)
		this.getPersistenceBrokerTemplate().store(rLink);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:12,代碼來源:DocumentLinkDAOOjbImpl.java

示例10: deleteDocmentLinksByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
public void deleteDocmentLinksByDocId(String docId){
	List<DocumentLink> links = getLinkedDocumentsByDocId(docId);
	for(DocumentLink link: links){
		deleteDocumentLink(link);
	}
	
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:8,代碼來源:DocumentLinkDAOOjbImpl.java

示例11: getLinkedDocumentsByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
/**
 * This overridden method ...
 * 
 * @see org.kuali.rice.kew.documentlink.dao.DocumentLinkDAO#getLinkedDocumentByDocId(java.lang.Long)
 */
public List<DocumentLink> getLinkedDocumentsByDocId(String docId) {
	Criteria crit = new Criteria();
	crit.addEqualTo("orgnDocId", docId);
	QueryByCriteria query = new QueryByCriteria(DocumentLink.class, crit);
	query.addOrderByAscending("orgnDocId");
	return (List<DocumentLink>) this.getPersistenceBrokerTemplate().getCollectionByQuery(query);  
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:13,代碼來源:DocumentLinkDAOOjbImpl.java

示例12: getOutgoingLinkedDocumentsByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
public List<DocumentLink> getOutgoingLinkedDocumentsByDocId(String docId) {
	Criteria crit = new Criteria();
	crit.addEqualTo("destDocId", docId);
	QueryByCriteria query = new QueryByCriteria(DocumentLink.class, crit);
	query.addOrderByAscending("destDocId");
	return (List<DocumentLink>) this.getPersistenceBrokerTemplate().getCollectionByQuery(query);  
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:8,代碼來源:DocumentLinkDAOOjbImpl.java

示例13: getLinkedDocument

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
/**
 * This overridden method ...
 * 
 * @see org.kuali.rice.kew.documentlink.dao.DocumentLinkDAO#getLinkedDocument(org.kuali.rice.kew.documentlink.DocumentLink)
 */
public DocumentLink getLinkedDocument(DocumentLink link) {
	Criteria crit = new Criteria();
	crit.addEqualTo("orgnDocId", link.getOrgnDocId());
	crit.addEqualTo("destDocId", link.getDestDocId());
	QueryByCriteria query = new QueryByCriteria(DocumentLink.class, crit);
	query.addOrderByAscending("orgnDocId");
	return (DocumentLink) this.getPersistenceBrokerTemplate().getObjectByQuery(query);  
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:14,代碼來源:DocumentLinkDAOOjbImpl.java

示例14: deleteDocmentLinksByDocId

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
/**
 * double delete all links from orgn doc
 * 
 * @see org.kuali.rice.kew.documentlink.dao.DocumentLinkDAO#deleteDocmentLinksByDocId(java.lang.Long)
 */
public void deleteDocmentLinksByDocId(String docId) {
	List<DocumentLink> links = getLinkedDocumentsByDocId(docId);
	for(DocumentLink link: links){
		deleteDocumentLink(link);
	}
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:12,代碼來源:DocumentLinkDAOJpaImpl.java

示例15: getLinkedDocument

import org.kuali.rice.kew.documentlink.DocumentLink; //導入依賴的package包/類
/**
 * get a link from orgn doc
 * 
 * @see org.kuali.rice.kew.documentlink.dao.DocumentLinkDAO#getLinkedDocument(org.kuali.rice.kew.documentlink.DocumentLink)
 */
public DocumentLink getLinkedDocument(DocumentLink link) {
	Criteria crit = new Criteria(DocumentLink.class.getName());
	crit.eq("orgnDocId", link.getOrgnDocId());
	crit.eq("destDocId", link.getDestDocId());
	try {
		return (DocumentLink) new QueryByCriteria(entityManager, crit).toQuery().getSingleResult();
	} catch (NoResultException e) {
		return null;
	}
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:16,代碼來源:DocumentLinkDAOJpaImpl.java


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