mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Extended Properties to batch updates. This is really a salvage
from an aborted attempt to make basic attributes (creator, modifier, owner, modtime etc.) plain Properties. This resulted in a 30% performance hit. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3362 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,8 @@ public class AVMNodePropertyDAOHibernate extends HibernateDaoSupport
|
||||
"from AVMNodePropertyImpl anp where anp.node = :node and anp.name = :name");
|
||||
query.setEntity("node", node);
|
||||
query.setParameter("name", name);
|
||||
query.setCacheable(true);
|
||||
query.setCacheRegion("Property.Lookup");
|
||||
return (AVMNodeProperty)query.uniqueResult();
|
||||
}
|
||||
|
||||
@@ -44,6 +46,8 @@ public class AVMNodePropertyDAOHibernate extends HibernateDaoSupport
|
||||
getSession().createQuery(
|
||||
"from AVMNodePropertyImpl anp where anp.node = :node");
|
||||
query.setEntity("node", node);
|
||||
query.setCacheable(true);
|
||||
query.setCacheRegion("Properties.Lookup");
|
||||
return (List<AVMNodeProperty>)query.list();
|
||||
}
|
||||
|
||||
@@ -64,4 +68,16 @@ public class AVMNodePropertyDAOHibernate extends HibernateDaoSupport
|
||||
{
|
||||
// Do nothing for Hibernate.
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all properties associated with a node.
|
||||
* @param node The AVMNode whose properties should be deleted.
|
||||
*/
|
||||
public void deleteAll(AVMNode node)
|
||||
{
|
||||
Query delete =
|
||||
getSession().createQuery("delete from AVMNodePropertyImpl anp where anp.node = :node");
|
||||
delete.setEntity("node", node);
|
||||
delete.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user