Moved the tracking of newly introduced nodes into its own table. Simplifies things a bit.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3320 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-13 15:48:10 +00:00
parent fae76d7896
commit 6ac87efa5a
20 changed files with 342 additions and 129 deletions

View File

@@ -35,21 +35,11 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
*/
private int fVersionID;
/**
* The Repository that owns this.
*/
private Repository fRepository;
/**
* The basic attributes of this. Owner, creator, mod time, etc.
*/
private BasicAttributes fBasicAttributes;
/**
* Whether this node is new (and should therefore not be COWed).
*/
private boolean fIsNew;
/**
* The version number (for concurrency control).
*/
@@ -77,16 +67,14 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
{
fID = id;
fVersionID = -1;
fRepository = repo;
fIsRoot = false;
long time = System.currentTimeMillis();
fBasicAttributes = new BasicAttributesImpl("britt",
"britt",
"britt",
time,
time,
time);
fIsNew = true;
"britt",
"britt",
time,
time,
time);
}
/**
@@ -139,24 +127,6 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
return AVMContext.fgInstance.fAVMNodeDAO.getMergedFrom(this);
}
/**
* Set the owning repository for this.
* @param repo The owning repository.
*/
public void setRepository(Repository repo)
{
fRepository = repo;
}
/**
* Get the repository that owns this.
* @return The repository.
*/
public Repository getRepository()
{
return fRepository;
}
/**
* Equality based on object ids.
* @param obj The thing to compare against.
@@ -241,22 +211,13 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
return fBasicAttributes;
}
/**
* Set whether this is new.
* @param isNew Whether this is new.
*/
public void setIsNew(boolean isNew)
{
fIsNew = isNew;
}
/**
* Get whether this is a new node.
* @return Whether this is new.
*/
public boolean getIsNew()
{
return fIsNew;
return AVMContext.fgInstance.fNewInRepositoryDAO.getByNode(this) != null;
}
/**