use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method moveNodeData.
@Override
protected void moveNodeData(Long fromNodeId, Long toNodeId) {
IdsEntity params = new IdsEntity();
params.setIdOne(fromNodeId);
params.setIdTwo(toNodeId);
int countPA = template.update(UPDATE_MOVE_PARENT_ASSOCS, params);
int countCA = template.update(UPDATE_MOVE_CHILD_ASSOCS, params);
int countSA = template.update(UPDATE_MOVE_SOURCE_ASSOCS, params);
int countTA = template.update(UPDATE_MOVE_TARGET_ASSOCS, params);
int countP = template.update(UPDATE_MOVE_PROPERTIES, params);
int countA = template.update(UPDATE_MOVE_ASPECTS, params);
if (isDebugEnabled) {
logger.debug("Moved node data: \n" + " From: " + fromNodeId + "\n" + " To: " + toNodeId + "\n" + " PA: " + countPA + "\n" + " CA: " + countCA + "\n" + " SA: " + countSA + "\n" + " TA: " + countTA + "\n" + " P: " + countP + "\n" + " A: " + countA);
}
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method deleteNodeAssocs.
@Override
protected int deleteNodeAssocs(List<Long> ids) {
IdsEntity param = new IdsEntity();
param.setIds(ids);
return template.delete(DELETE_NODE_ASSOCS, param);
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectNodePropertiesByTypes.
@Override
@SuppressWarnings("rawtypes")
public List<NodePropertyEntity> selectNodePropertiesByTypes(Set<QName> qnames) {
final List<NodePropertyEntity> properties = new ArrayList<NodePropertyEntity>();
// qnames of properties that are encrypted
Set<Long> qnameIds = qnameDAO.convertQNamesToIds(qnames, false);
if (qnameIds.size() > 0) {
IdsEntity param = new IdsEntity();
param.setIds(new ArrayList<Long>(qnameIds));
// TODO - use a callback approach
template.select(SELECT_PROPERTIES_BY_TYPES, param, new ResultHandler() {
@Override
public void handleResult(ResultContext context) {
properties.add((NodePropertyEntity) context.getResultObject());
}
});
}
return properties;
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method deleteChildAssocs.
@Override
protected int deleteChildAssocs(List<Long> ids) {
IdsEntity idsEntity = new IdsEntity();
// IDs
idsEntity.setIds(ids);
return template.delete(DELETE_CHILD_ASSOCS, idsEntity);
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectChildAssocsWithoutNodeAssocsOfTypes.
@Override
public List<Node> selectChildAssocsWithoutNodeAssocsOfTypes(Long parentNodeId, Long minNodeId, Long maxNodeId, Set<QName> assocTypeQNames) {
IdsEntity idsEntity = new IdsEntity();
// Parent node id
Assert.notNull(parentNodeId, "The parent node id must not be null.");
idsEntity.setIdOne(parentNodeId);
// Node ids selection interval
idsEntity.setIdTwo(minNodeId);
idsEntity.setIdThree(maxNodeId);
// Associations types to exclude
if (assocTypeQNames != null) {
Set<Long> childNodeTypeQNameIds = qnameDAO.convertQNamesToIds(assocTypeQNames, false);
if (childNodeTypeQNameIds.size() > 0) {
idsEntity.setIds(new ArrayList<Long>(childNodeTypeQNameIds));
}
}
return template.selectList(SELECT_CHILD_ASSOCS_OF_PARENT_WITHOUT_NODE_ASSOCS_OF_TYPE, idsEntity);
}
Aggregations