本文整理汇总了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);
}
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
}