public List queryForList(String statementName) { return delegate.selectList(translateStatementName(statementName)); }
public List queryForList(String statementName, Object parameter) { return delegate.selectList(translateStatementName(statementName), parameter); }
@SuppressWarnings("unchecked") @Override protected List<AppliedPatchEntity> getAppliedPatchEntities() { return template.selectList(SELECT_ALL_APPLIED_PATCH); } }
@SuppressWarnings("unchecked") @Override protected List<Map<String, Object>> getAceAndAuthorityEntitiesByAcl(long aclEntityId) { Map<String, Object> params = new HashMap<String, Object>(1); params.put("id", aclEntityId); return template.selectList(SELECT_ACES_AND_AUTHORIES_BY_ACL, params); }
@SuppressWarnings("unchecked") @Override protected List<Long> getAclEntitiesThatInheritFromAcl(long aclEntityId) { Map<String, Object> params = new HashMap<String, Object>(2); params.put("id", aclEntityId); params.put("bool", true); return template.selectList(SELECT_ACLS_THAT_INHERIT_FROM_ACL, params); }
@SuppressWarnings("unchecked") @Override public List<Long> getNodesByTypeQNameAndAspectQNameId(long typeQNameId, long aspectQNameId, long minNodeId, long maxNodeId) { Map<String, Object> params = new HashMap<String, Object>(); params.put("qnameId1", typeQNameId); params.put("qnameId2", aspectQNameId); params.put("minNodeId", minNodeId); params.put("maxNodeId", maxNodeId); return template.selectList(SELECT_NODES_BY_TYPE_AND_ASPECT_QNAME, params); }
@SuppressWarnings("unchecked") @Override protected List<Long> getADMNodeEntityIdsByAcl(long aclEntityId, int maxResults) { if (maxResults < 0) { maxResults = RowBounds.NO_ROW_LIMIT; } Map<String, Object> params = new HashMap<String, Object>(1); params.put("id", aclEntityId); return template.selectList(SELECT_ADM_NODES_BY_ACL, params, new RowBounds(0 , maxResults)); }
@Override protected List<AuthorityBridgeLink> selectAuthorityBridgeLinks(Long authorityContainerTypeQNameId, Long memberAssocQNameId, Long authorityNameQNameId, Long storeId) { Long start = (logger.isDebugEnabled() ? System.currentTimeMillis() : null); AuthorityBridgeParametersEntity authorityBridgeParametersEntity = new AuthorityBridgeParametersEntity(authorityContainerTypeQNameId, memberAssocQNameId, authorityNameQNameId, storeId); List<AuthorityBridgeLink> links = template.selectList(QUERY_SELECT_GET_AUTHORITY_BRIDGE_ENTRIES, authorityBridgeParametersEntity); if (start != null) { logger.debug("Authority bridge query: "+links.size()+" in "+(System.currentTimeMillis()-start)+" msecs"); } return links; }
@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); }
@Override public Map<String, Integer> countSymmetricKeysForMasterKeys() { Map<String, Integer> counts = new HashMap<>(); List<SymmetricKeyCount> res = template.selectList(COUNT_SYMMETRIC_KEYS_FOR_MASTER_KEYS); for(SymmetricKeyCount count : res) { counts.put(count.getMasterKeyAlias(), count.getCount()); } return counts; }
@Override protected List<Node> selectNodesByIds(SortedSet<Long> ids) { NodeBatchLoadEntity nodeBatchLoadEntity = new NodeBatchLoadEntity(); // IDs nodeBatchLoadEntity.setIds(new ArrayList<Long>(ids)); return template.selectList(SELECT_NODES_BY_IDS, nodeBatchLoadEntity); }
@Override protected Map<NodeVersionKey, Map<NodePropertyKey, NodePropertyValue>> selectNodeProperties(Set<Long> nodeIds) { if (nodeIds.size() == 0) { return Collections.emptyMap(); } NodePropertyEntity prop = new NodePropertyEntity(); prop.setNodeIds(new ArrayList<Long>(nodeIds)); List<NodePropertyEntity> rows = template.selectList(SELECT_NODE_PROPERTIES, prop); return makePersistentPropertiesMap(rows); }
@Override protected List<NodeAssocEntity> selectNodeAssocs(Long nodeId) { // Node NodeEntity node = new NodeEntity(); node.setId(nodeId); return template.selectList(SELECT_NODE_ASSOCS, node); }
@SuppressWarnings("unchecked") @Override protected List<TenantEntity> getTenantEntities(Boolean enabled) { TenantQueryEntity entity = new TenantQueryEntity(); entity.setEnabled(enabled); return template.selectList(SELECT_TENANTS, entity); }
@Override protected List<PropertyIdSearchRow> findPropertyById(Long id) { PropertyValueEntity entity = new PropertyValueEntity(); entity.setId(id); List<PropertyIdSearchRow> results = template.selectList( SELECT_PROPERTY_BY_ID, entity); return results; }
@SuppressWarnings("unchecked") @Override public List<ActivityFeedEntity> selectSiteFeedEntries(String siteId, int maxFeedSize) throws SQLException { ActivityFeedQueryEntity params = new ActivityFeedQueryEntity(); params.setSiteNetwork(siteId); int rowLimit = maxFeedSize < 0 ? RowBounds.NO_ROW_LIMIT : maxFeedSize; RowBounds rowBounds = new RowBounds(RowBounds.NO_ROW_OFFSET, rowLimit); // for given site return template.selectList("alfresco.activities.select.select_activity_feed_for_site", params, rowBounds); } }
@Override public List<ContentUrlKeyEntity> getSymmetricKeysByMasterKeyAlias(String masterKeyAlias, long fromId, int maxResults) { ContentUrlKeyEntity entity = new ContentUrlKeyEntity(); entity.setMasterKeyAlias(masterKeyAlias); entity.setId(fromId); List<ContentUrlKeyEntity> results = template.selectList(SELECT_SYMMETRIC_KEYS_BY_MASTER_KEY, entity, new RowBounds(0, maxResults)); return results; }
@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); }
@Override public List<NodeIdAndAclId> selectPrimaryChildAcls(Long nodeId) { ChildAssocEntity assoc = new ChildAssocEntity(); // Parent NodeEntity parentNode = new NodeEntity(); parentNode.setId(nodeId); assoc.setParentNode(parentNode); // Primary assoc.setPrimary(true); return template.selectList(SELECT_NODE_PRIMARY_CHILD_ACLS, assoc); }
@Override protected List<NodeAssocEntity> selectNodeAssocsByTarget(Long targetNodeId, Long typeQNameId) { NodeAssocEntity assoc = new NodeAssocEntity(); // Target NodeEntity targetNode = new NodeEntity(); targetNode.setId(targetNodeId); assoc.setTargetNode(targetNode); // Type assoc.setTypeQNameId(typeQNameId); return template.selectList(SELECT_NODE_ASSOCS_BY_TARGET, assoc); }