use of org.alfresco.repo.domain.node.ChildAssocEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectParentAssocs.
@Override
protected void selectParentAssocs(Long childNodeId, QName assocTypeQName, QName assocQName, Boolean isPrimary, ChildAssocRefQueryCallback resultsCallback) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Child
NodeEntity childNode = new NodeEntity();
childNode.setId(childNodeId);
assoc.setChildNode(childNode);
// Type QName
if (assocTypeQName != null) {
if (!assoc.setTypeQNameAll(qnameDAO, assocTypeQName, false)) {
resultsCallback.done();
// Shortcut
return;
}
}
// QName
if (assocQName != null) {
if (!assoc.setQNameAll(qnameDAO, assocQName, false)) {
resultsCallback.done();
// Shortcut
return;
}
}
// Primary
if (isPrimary != null) {
assoc.setPrimary(isPrimary);
}
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
template.select(SELECT_PARENT_ASSOCS_OF_CHILD, assoc, resultHandler);
resultsCallback.done();
}
use of org.alfresco.repo.domain.node.ChildAssocEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method updateChildAssocUniqueName.
@Override
protected int updateChildAssocUniqueName(Long assocId, String name) {
ChildAssocEntity assoc = new ChildAssocEntity();
assoc.setId(assocId);
// Name
assoc.setChildNodeNameAll(null, null, name);
return template.update(UPDATE_CHILD_ASSOC_UNIQUE_NAME, assoc);
}
use of org.alfresco.repo.domain.node.ChildAssocEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectChildAssocsByChildTypes.
@Override
protected void selectChildAssocsByChildTypes(Long parentNodeId, Set<QName> childNodeTypeQNames, ChildAssocRefQueryCallback resultsCallback) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Parent
NodeEntity parentNode = new NodeEntity();
parentNode.setId(parentNodeId);
assoc.setParentNode(parentNode);
// Child Node Type QNames
Set<Long> childNodeTypeQNameIds = qnameDAO.convertQNamesToIds(childNodeTypeQNames, false);
if (childNodeTypeQNameIds.size() == 0) {
resultsCallback.done();
// Shortcut as they don't exist
return;
}
assoc.setChildNodeTypeQNameIds(new ArrayList<Long>(childNodeTypeQNameIds));
// Ordered
assoc.setOrdered(resultsCallback.orderResults());
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
template.select(SELECT_CHILD_ASSOCS_OF_PARENT, assoc, resultHandler);
resultsCallback.done();
}
use of org.alfresco.repo.domain.node.ChildAssocEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectPrimaryParentAssocs.
@Override
protected List<ChildAssocEntity> selectPrimaryParentAssocs(Long childNodeId) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Child
NodeEntity childNode = new NodeEntity();
childNode.setId(childNodeId);
assoc.setChildNode(childNode);
// Primary
assoc.setPrimary(Boolean.TRUE);
return template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
}
use of org.alfresco.repo.domain.node.ChildAssocEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectParentAssocs.
@Override
protected List<ChildAssocEntity> selectParentAssocs(Long childNodeId) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Child
NodeEntity childNode = new NodeEntity();
childNode.setId(childNodeId);
assoc.setChildNode(childNode);
return template.selectList(SELECT_PARENT_ASSOCS_OF_CHILD, assoc);
}
Aggregations