use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class PatchDAOImpl method getCountNodesWithAspects.
@Override
public long getCountNodesWithAspects(Set<QName> qnames) {
// Resolve QNames
Set<Long> qnameIds = qnameDAO.convertQNamesToIds(qnames, false);
if (qnameIds.size() == 0) {
return 0L;
}
IdsEntity params = new IdsEntity();
params.setIds(new ArrayList<Long>(qnameIds));
Long count = template.selectOne(SELECT_COUNT_NODES_WITH_ASPECTS, params);
if (count == null) {
return 0L;
} else {
return count;
}
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class ContentDataDAOImpl method getContentDataEntitiesForNodes.
@Override
protected List<ContentDataEntity> getContentDataEntitiesForNodes(Set<Long> nodeIds) {
if (nodeIds.size() == 0) {
// There will be no results
return Collections.emptyList();
}
IdsEntity idsEntity = new IdsEntity();
idsEntity.setIds(new ArrayList<Long>(nodeIds));
return template.selectList(SELECT_CONTENT_DATA_BY_NODE_IDS, idsEntity);
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class NodeDAOImpl method selectNodePropertiesByDataType.
@SuppressWarnings("rawtypes")
@Override
public List<NodePropertyEntity> selectNodePropertiesByDataType(QName dataType, long minNodeId, long maxNodeId) {
int typeOrdinal = NodePropertyValue.convertToTypeOrdinal(dataType);
IdsEntity ids = new IdsEntity();
ids.setIdOne((long) typeOrdinal);
ids.setIdTwo(minNodeId);
ids.setIdThree(maxNodeId);
final List<NodePropertyEntity> properties = new ArrayList<NodePropertyEntity>();
template.select(SELECT_PROPERTIES_BY_ACTUAL_TYPE, ids, 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 updateNodes.
@Override
protected int updateNodes(Long txnId, List<Long> nodeIds) {
if (nodeIds.size() == 0) {
return 0;
}
IdsEntity ids = new IdsEntity();
ids.setIdOne(txnId);
ids.setIds(nodeIds);
return template.update(UPDATE_NODE_BULK_TOUCH, ids);
}
use of org.alfresco.ibatis.IdsEntity in project alfresco-repository by Alfresco.
the class PatchDAOImpl method getCountNodesWithTypId.
@Override
public long getCountNodesWithTypId(QName typeQName) {
// Resolve the QName
Pair<Long, QName> qnameId = qnameDAO.getQName(typeQName);
if (qnameId == null) {
return 0L;
}
IdsEntity params = new IdsEntity();
params.setIdOne(qnameId.getFirst());
Long count = (Long) template.selectOne(SELECT_COUNT_NODES_WITH_TYPE_ID, params);
if (count == null) {
return 0L;
} else {
return count;
}
}
Aggregations