Change to mapping of AVM aspects.

This seems to make indexing a bit quicker, and at least doesn't make other things
slower. Bulk import now just sucks; it used to be an order of magnitude suckier.
98% of that is due to Andy's recent changes.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6103 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2007-06-26 01:15:39 +00:00
parent 4c232e02b1
commit cf0685b7ef
26 changed files with 306 additions and 194 deletions

View File

@@ -25,8 +25,10 @@ package org.alfresco.repo.avm;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.alfresco.repo.avm.util.RawServices;
import org.alfresco.repo.domain.DbAccessControlList;
@@ -83,11 +85,17 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
*/
private String fGUID;
/**
* The Aspects that belong to this node.
*/
private Set<QName> fAspects;
/**
* Default constructor.
*/
protected AVMNodeImpl()
{
fAspects = new HashSet<QName>();
}
/**
@@ -98,6 +106,7 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
protected AVMNodeImpl(long id,
AVMStore store)
{
fAspects = new HashSet<QName>();
fID = id;
fVersionID = -1;
fIsRoot = false;
@@ -351,16 +360,7 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
*/
protected void copyAspects(AVMNode other)
{
List<AVMAspectName> aspects =
AVMDAOs.Instance().fAVMAspectNameDAO.get(other);
for (AVMAspectName name : aspects)
{
AVMAspectName newName =
new AVMAspectNameImpl();
newName.setName(name.getName());
newName.setNode(this);
AVMDAOs.Instance().fAVMAspectNameDAO.save(newName);
}
fAspects = new HashSet<QName>(other.getAspects());
}
protected void copyACLs(AVMNode other)
@@ -538,4 +538,21 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
{
fGUID = guid;
}
/* (non-Javadoc)
* @see org.alfresco.repo.avm.AVMNode#getAspects()
*/
public Set<QName> getAspects()
{
return fAspects;
}
/**
* Set the aspects on this node.
* @param aspects
*/
public void setAspects(Set<QName> aspects)
{
fAspects = aspects;
}
}