Merged V2.9 to HEAD

10561: Merged V2.2 to V2.9
      9882: Node DAO separation
   10580: Merged V2.2 to V2.9
      10576: Missing onContentDelete firing
      10577: More policies: beforeCreateNode and beforeDeleteNode when archiving nodes in hierarchy
         - Updated UsageService and TenantService to conform to the new node DAO (more separation)
         - TODO: Tenant node interceptor not present.  This must be added if Multi-Tentant features are required.
   - NodeMonitor event processing now checks that the nodes are still valid before processing.
   - onMove firing was breaking NodeMonitor.  Changed onMove to not fire when nodes are moved between stores.
   - Raised ALFCOM-1912: ClassCastException when accessing property of type ver2:versionNumber
   - Pull setFixedAcls fully into Node DAO for simpler and speedier execution


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10709 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-09-04 00:11:13 +00:00
parent 0876d67c4d
commit 3227355279
58 changed files with 4610 additions and 3230 deletions

View File

@@ -700,4 +700,48 @@ public class HibernateNodeTest extends BaseSpringTest
count++;
}
}
private static final String GET_NODE =
" select"+
" node" +
" from" +
" org.alfresco.repo.domain.hibernate.NodeImpl as node" +
" where" +
" node.id in (:nodeIds)";
@SuppressWarnings("unchecked")
public void testPropertiesViaJoin() throws Exception
{
getSession().setCacheMode(CacheMode.IGNORE);
List<Long> nodeIds = new ArrayList<Long>(10);
for (int i = 0; i < 100; i++)
{
// make a container node
Node node = new NodeImpl();
node.setStore(store);
node.setUuid(GUID.generate());
node.setTypeQName(containerQNameEntity);
node.getProperties().put(propAuthorQNameEntity.getId(), new PropertyValue(DataTypeDefinition.TEXT, "ABC"));
node.getProperties().put(propArchivedByQNameEntity.getId(), new PropertyValue(DataTypeDefinition.TEXT, "ABC"));
Long nodeId = (Long) getSession().save(node);
// Keep the ID
nodeIds.add(nodeId);
}
getSession().flush();
getSession().clear();
// Now select it
Query query = getSession()
.createQuery(GET_NODE)
.setParameterList("nodeIds", nodeIds)
.setCacheMode(CacheMode.IGNORE);
List<Node> queryList = (List<Node>) query.list();
for (Node node : queryList)
{
// Get the node properties - this should not execute a query to retrieve
node.getProperties().size();
}
}
}