当前位置: 首页>>代码示例>>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;未经允许,请勿转载。