use of org.alfresco.repo.domain.node.NodeEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectChildAssoc.
@Override
protected ChildAssocEntity selectChildAssoc(Long parentNodeId, QName assocTypeQName, String childName) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Parent
NodeEntity parentNode = new NodeEntity();
parentNode.setId(parentNodeId);
assoc.setParentNode(parentNode);
// Type QName
if (!assoc.setTypeQNameAll(qnameDAO, assocTypeQName, false)) {
// Shortcut
return null;
}
// Child name
assoc.setChildNodeNameAll(null, assocTypeQName, childName);
// Ordered
assoc.setOrdered(false);
// Note: This single results was assumed from inception of the original method. It's correct.
return template.selectOne(SELECT_CHILD_ASSOC_OF_PARENT_BY_NAME, assoc);
}
use of org.alfresco.repo.domain.node.NodeEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectChildAssoc.
@Override
protected List<ChildAssocEntity> selectChildAssoc(Long parentNodeId, Long childNodeId, QName assocTypeQName, QName assocQName) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Parent
NodeEntity parentNode = new NodeEntity();
parentNode.setId(parentNodeId);
assoc.setParentNode(parentNode);
// Child
NodeEntity childNode = new NodeEntity();
childNode.setId(childNodeId);
assoc.setChildNode(childNode);
// Type QName
if (!assoc.setTypeQNameAll(qnameDAO, assocTypeQName, false)) {
// Shortcut
return Collections.emptyList();
}
// QName
if (!assoc.setQNameAll(qnameDAO, assocQName, false)) {
// Shortcut
return Collections.emptyList();
}
// Ordered
assoc.setOrdered(false);
return template.selectList(SELECT_CHILD_ASSOCS_OF_PARENT, assoc);
}
use of org.alfresco.repo.domain.node.NodeEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectChildAssocsWithoutParentAssocsOfType.
@Override
protected void selectChildAssocsWithoutParentAssocsOfType(Long parentNodeId, QName assocTypeQName, ChildAssocRefQueryCallback resultsCallback) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Parent
NodeEntity parentNode = new NodeEntity();
parentNode.setId(parentNodeId);
assoc.setParentNode(parentNode);
// Type QName
if (!assoc.setTypeQNameAll(qnameDAO, assocTypeQName, false)) {
resultsCallback.done();
// Shortcut
return;
}
// Ordered
assoc.setOrdered(resultsCallback.orderResults());
ChildAssocResultHandler resultHandler = new ChildAssocResultHandler(resultsCallback);
template.select(SELECT_CHILD_ASSOCS_OF_PARENT_WITHOUT_PARENT_ASSOCS_OF_TYPE, assoc, resultHandler);
resultsCallback.done();
}
use of org.alfresco.repo.domain.node.NodeEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectNodeAssocs.
@Override
protected List<NodeAssocEntity> selectNodeAssocs(Long nodeId) {
// Node
NodeEntity node = new NodeEntity();
node.setId(nodeId);
return template.selectList(SELECT_NODE_ASSOCS, node);
}
use of org.alfresco.repo.domain.node.NodeEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method updateChildAssocIndex.
@Override
protected int updateChildAssocIndex(Long parentNodeId, Long childNodeId, QName assocTypeQName, QName assocQName, int index) {
ChildAssocEntity assoc = new ChildAssocEntity();
// Parent
NodeEntity parentNode = new NodeEntity();
parentNode.setId(parentNodeId);
assoc.setParentNode(parentNode);
// Child
NodeEntity childNode = new NodeEntity();
childNode.setId(childNodeId);
assoc.setChildNode(childNode);
// Type QName
assoc.setTypeQNameAll(qnameDAO, assocTypeQName, true);
// QName
assoc.setQNameAll(qnameDAO, assocQName, true);
// Index
assoc.setAssocIndex(index);
return template.update(UPDATE_CHILD_ASSOCS_INDEX, assoc);
}
Aggregations