diff --git a/config/alfresco/avm-services-context.xml b/config/alfresco/avm-services-context.xml
index c3073e9ade..f7d2ad3c0e 100644
--- a/config/alfresco/avm-services-context.xml
+++ b/config/alfresco/avm-services-context.xml
@@ -78,12 +78,6 @@
-
-
-
-
-
-
@@ -127,9 +121,6 @@
-
-
-
diff --git a/source/java/org/alfresco/repo/avm/AVMContext.java b/source/java/org/alfresco/repo/avm/AVMContext.java
index e6daa146ad..3fc8ae8f6f 100644
--- a/source/java/org/alfresco/repo/avm/AVMContext.java
+++ b/source/java/org/alfresco/repo/avm/AVMContext.java
@@ -70,11 +70,6 @@ public class AVMContext implements ApplicationContextAware
*/
public DeletedChildDAO fDeletedChildDAO;
- /**
- * The NewInAVMStoreDAO
- */
- public NewInAVMStoreDAO fNewInAVMStoreDAO;
-
/**
* The AVMNodePropertyDAO
*/
@@ -196,14 +191,6 @@ public class AVMContext implements ApplicationContextAware
fIssuerDAO = issuerDAO;
}
- /**
- * @param newInAVMStoreDAO The DAO to set.
- */
- public void setNewInAVMStoreDAO(NewInAVMStoreDAO newInAVMStoreDAO)
- {
- fNewInAVMStoreDAO = newInAVMStoreDAO;
- }
-
public void setAvmNodePropertyDAO(AVMNodePropertyDAO avmNodePropertyDAO)
{
fAVMNodePropertyDAO = avmNodePropertyDAO;
diff --git a/source/java/org/alfresco/repo/avm/AVMCrawler.java b/source/java/org/alfresco/repo/avm/AVMCrawler.java
index fb299e06ff..65f7322286 100644
--- a/source/java/org/alfresco/repo/avm/AVMCrawler.java
+++ b/source/java/org/alfresco/repo/avm/AVMCrawler.java
@@ -31,6 +31,7 @@ import org.alfresco.service.cmr.avm.AVMException;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
+import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.hibernate.HibernateException;
import org.springframework.dao.ConcurrencyFailureException;
@@ -241,6 +242,10 @@ class AVMCrawler implements Runnable
{
return;
}
+ if (e instanceof InvalidNodeRefException)
+ {
+ return;
+ }
throw new AVMException("Failure", e);
}
}
diff --git a/source/java/org/alfresco/repo/avm/AVMNode.java b/source/java/org/alfresco/repo/avm/AVMNode.java
index 85fe9825cb..84bacfbfb4 100644
--- a/source/java/org/alfresco/repo/avm/AVMNode.java
+++ b/source/java/org/alfresco/repo/avm/AVMNode.java
@@ -185,4 +185,16 @@ public interface AVMNode
* @return The ACL on this node.
*/
public DbAccessControlList getAcl();
+
+ /**
+ * Set the store that we are new in.
+ * @param store The store we are new in.
+ */
+ public void setStoreNew(AVMStore store);
+
+ /**
+ * Get the possibly null store that we're new in.
+ * @return The store that we're new in.
+ */
+ public AVMStore getStoreNew();
}
\ No newline at end of file
diff --git a/source/java/org/alfresco/repo/avm/AVMNodeDAO.java b/source/java/org/alfresco/repo/avm/AVMNodeDAO.java
index ecd0140f64..f632d942cf 100644
--- a/source/java/org/alfresco/repo/avm/AVMNodeDAO.java
+++ b/source/java/org/alfresco/repo/avm/AVMNodeDAO.java
@@ -82,6 +82,13 @@ public interface AVMNodeDAO
*/
public List getContentUrls();
+ /**
+ * Get all the nodes that are new in the given store.
+ * @param store The store to query.
+ * @return A List of AVMNodes.
+ */
+ public List getNewInStore(AVMStore store);
+
/**
* Inappropriate hack to get Hibernate to play nice.
*/
diff --git a/source/java/org/alfresco/repo/avm/AVMNodeImpl.java b/source/java/org/alfresco/repo/avm/AVMNodeImpl.java
index 645aaa8759..be8400fdfc 100644
--- a/source/java/org/alfresco/repo/avm/AVMNodeImpl.java
+++ b/source/java/org/alfresco/repo/avm/AVMNodeImpl.java
@@ -62,6 +62,11 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
*/
private DbAccessControlList fACL;
+ /**
+ * The Store that we're new in.
+ */
+ private AVMStore fStoreNew;
+
/**
* Default constructor.
*/
@@ -93,6 +98,7 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
time,
time,
time);
+ fStoreNew = store;
}
/**
@@ -234,7 +240,7 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
*/
public boolean getIsNew()
{
- return AVMContext.fgInstance.fNewInAVMStoreDAO.getByNode(this) != null;
+ return fStoreNew != null;
}
/**
@@ -401,4 +407,22 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
{
return fACL;
}
+
+ /**
+ * Set the store we are new in.
+ * @param store The store we are new in.
+ */
+ public void setStoreNew(AVMStore store)
+ {
+ fStoreNew = store;
+ }
+
+ /**
+ * Get the possibly null store we are new in.
+ * @return The store we are new in.
+ */
+ public AVMStore getStoreNew()
+ {
+ return fStoreNew;
+ }
}
diff --git a/source/java/org/alfresco/repo/avm/AVMRepository.java b/source/java/org/alfresco/repo/avm/AVMRepository.java
index e61d887299..dd48b41a1b 100644
--- a/source/java/org/alfresco/repo/avm/AVMRepository.java
+++ b/source/java/org/alfresco/repo/avm/AVMRepository.java
@@ -186,8 +186,7 @@ public class AVMRepository
@SuppressWarnings("unused")
AVMStore rep = new AVMStoreImpl(this, name);
// Special handling for AVMStore creation.
- NewInAVMStore newInRep = AVMContext.fgInstance.fNewInAVMStoreDAO.getByNode(rep.getRoot());
- AVMContext.fgInstance.fNewInAVMStoreDAO.delete(newInRep);
+ rep.getRoot().setStoreNew(null);
}
/**
@@ -449,10 +448,10 @@ public class AVMRepository
node.setIsRoot(false);
vrDAO.delete(vr);
}
- List newGuys = AVMContext.fgInstance.fNewInAVMStoreDAO.getByAVMStore(store);
- for (NewInAVMStore newGuy : newGuys)
+ List newGuys = AVMContext.fgInstance.fAVMNodeDAO.getNewInStore(store);
+ for (AVMNode newGuy : newGuys)
{
- AVMContext.fgInstance.fNewInAVMStoreDAO.delete(newGuy);
+ newGuy.setStoreNew(null);
}
AVMContext.fgInstance.fAVMStorePropertyDAO.delete(store);
AVMContext.fgInstance.fAVMStoreDAO.delete(store);
diff --git a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java
index fb680db5de..75d159fe8b 100644
--- a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java
+++ b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java
@@ -143,10 +143,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMExistsException("Already snapshotted.");
}
// Clear out the new nodes.
- List newInRep = AVMContext.fgInstance.fNewInAVMStoreDAO.getByAVMStore(this);
- for (NewInAVMStore newGuy : newInRep)
+ List newInRep = AVMContext.fgInstance.fAVMNodeDAO.getNewInStore(this);
+ for (AVMNode newGuy : newInRep)
{
- AVMContext.fgInstance.fNewInAVMStoreDAO.delete(newGuy);
+ newGuy.setStoreNew(null);
}
// Make up a new version record.
VersionRoot versionRoot = new VersionRootImpl(this,
diff --git a/source/java/org/alfresco/repo/avm/AVMTester.java b/source/java/org/alfresco/repo/avm/AVMTester.java
index 3f6ff0ee72..5422e66817 100644
--- a/source/java/org/alfresco/repo/avm/AVMTester.java
+++ b/source/java/org/alfresco/repo/avm/AVMTester.java
@@ -28,6 +28,7 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
+import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.avm.AVMCycleException;
import org.alfresco.service.cmr.avm.AVMException;
import org.alfresco.service.cmr.avm.AVMExistsException;
@@ -35,6 +36,9 @@ import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.AVMWrongTypeException;
+import org.alfresco.service.cmr.repository.InvalidNodeRefException;
+import org.hibernate.HibernateException;
+import org.springframework.dao.ConcurrencyFailureException;
/**
* This is a Runnable which randomly performs operations on an AVM Repository.
@@ -266,16 +270,9 @@ class AVMTester implements Runnable
out.close();
addFile(appendPath(path, name));
}
- catch (AVMException ae)
+ catch (Exception e)
{
- if (ae instanceof AVMExistsException ||
- ae instanceof AVMNotFoundException ||
- ae instanceof AVMWrongTypeException ||
- ae instanceof AVMCycleException)
- {
- return;
- }
- throw ae;
+ handleException(e);
}
}
@@ -289,16 +286,9 @@ class AVMTester implements Runnable
fService.createDirectory(path, name);
addDirectory(appendPath(path, name));
}
- catch (AVMException ae)
+ catch (Exception e)
{
- if (ae instanceof AVMExistsException ||
- ae instanceof AVMNotFoundException ||
- ae instanceof AVMWrongTypeException ||
- ae instanceof AVMCycleException)
- {
- return;
- }
- throw ae;
+ handleException(e);
}
}
@@ -333,16 +323,9 @@ class AVMTester implements Runnable
addFile(appendPath(dstPath, name));
}
}
- catch (AVMException ae)
+ catch (Exception e)
{
- if (ae instanceof AVMExistsException ||
- ae instanceof AVMNotFoundException ||
- ae instanceof AVMWrongTypeException ||
- ae instanceof AVMCycleException)
- {
- return;
- }
- throw ae;
+ handleException(e);
}
}
@@ -357,16 +340,9 @@ class AVMTester implements Runnable
fService.createLayeredDirectory(target, path, name);
addDirectory(appendPath(path, name));
}
- catch (AVMException ae)
+ catch (Exception e)
{
- if (ae instanceof AVMExistsException ||
- ae instanceof AVMNotFoundException ||
- ae instanceof AVMWrongTypeException ||
- ae instanceof AVMCycleException)
- {
- return;
- }
- throw ae;
+ handleException(e);
}
}
@@ -381,16 +357,9 @@ class AVMTester implements Runnable
fService.createLayeredFile(target, path, name);
addFile(appendPath(path, name));
}
- catch (AVMException ae)
+ catch (Exception e)
{
- if (ae instanceof AVMExistsException ||
- ae instanceof AVMNotFoundException ||
- ae instanceof AVMWrongTypeException ||
- ae instanceof AVMCycleException)
- {
- return;
- }
- throw ae;
+ handleException(e);
}
}
@@ -410,15 +379,9 @@ class AVMTester implements Runnable
fService.removeNode(path, name);
removePath(target);
}
- catch (AVMException e)
+ catch (Exception e)
{
- if (e instanceof AVMNotFoundException ||
- e instanceof AVMWrongTypeException ||
- e instanceof AVMCycleException)
- {
- return;
- }
- throw e;
+ handleException(e);
}
}
@@ -433,15 +396,9 @@ class AVMTester implements Runnable
out.println("I am " + path);
out.close();
}
- catch (AVMException e)
+ catch (Exception e)
{
- if (e instanceof AVMNotFoundException ||
- e instanceof AVMWrongTypeException ||
- e instanceof AVMCycleException)
- {
- return;
- }
- throw e;
+ handleException(e);
}
}
@@ -457,19 +414,9 @@ class AVMTester implements Runnable
System.out.println(line);
reader.close();
}
- catch (AVMException e)
+ catch (Exception e)
{
- if (e instanceof AVMNotFoundException ||
- e instanceof AVMWrongTypeException ||
- e instanceof AVMCycleException)
- {
- return;
- }
- throw e;
- }
- catch (IOException e)
- {
- throw new AVMException("I/O Error.", e);
+ handleException(e);
}
}
@@ -521,15 +468,9 @@ class AVMTester implements Runnable
}
}
}
- catch (AVMException e)
+ catch (Exception e)
{
- if (e instanceof AVMNotFoundException ||
- e instanceof AVMWrongTypeException ||
- e instanceof AVMCycleException)
- {
- return;
- }
- throw e;
+ handleException(e);
}
}
@@ -540,9 +481,9 @@ class AVMTester implements Runnable
{
fService.createSnapshot("main");
}
- catch (AVMExistsException aee)
+ catch (Exception e)
{
- // Do nothing. It's OK.
+ handleException(e);
}
}
@@ -628,4 +569,18 @@ class AVMTester implements Runnable
{
return fgOpCount;
}
+
+ private void handleException(Exception e)
+ {
+ e.printStackTrace(System.err);
+ if (e instanceof AVMException ||
+ e instanceof AlfrescoRuntimeException ||
+ e instanceof ConcurrencyFailureException ||
+ e instanceof HibernateException ||
+ e instanceof InvalidNodeRefException)
+ {
+ return;
+ }
+ throw new AVMException("Naughty Exception.", e);
+ }
}
diff --git a/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java b/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java
index 869dd0e6e6..cd1281033b 100644
--- a/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java
+++ b/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java
@@ -82,7 +82,6 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
fOpacity = false;
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
}
/**
@@ -114,7 +113,6 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
AVMContext.fgInstance.fDeletedChildDAO.save(newDel);
}
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(repos, this));
copyProperties(other);
}
@@ -148,7 +146,6 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
}
}
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
copyProperties(other);
}
@@ -172,7 +169,6 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
fOpacity = false;
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
copyProperties(dir);
}
diff --git a/source/java/org/alfresco/repo/avm/LayeredFileNodeImpl.java b/source/java/org/alfresco/repo/avm/LayeredFileNodeImpl.java
index 38c8167569..861131aa66 100644
--- a/source/java/org/alfresco/repo/avm/LayeredFileNodeImpl.java
+++ b/source/java/org/alfresco/repo/avm/LayeredFileNodeImpl.java
@@ -53,7 +53,6 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
fIndirection = other.getIndirection();
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
copyProperties(other);
}
@@ -68,7 +67,6 @@ class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
fIndirection = indirection;
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
}
/**
diff --git a/source/java/org/alfresco/repo/avm/NewInAVMStore.java b/source/java/org/alfresco/repo/avm/NewInAVMStore.java
deleted file mode 100644
index cf03bb8969..0000000000
--- a/source/java/org/alfresco/repo/avm/NewInAVMStore.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2006 Alfresco, Inc.
- *
- * Licensed under the Mozilla Public License version 1.1
- * with a permitted attribution clause. You may obtain a
- * copy of the License at
- *
- * http://www.alfresco.org/legal/license.txt
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the
- * License.
- */
-
-package org.alfresco.repo.avm;
-
-/**
- * Eensy-weensy interface for tracking nodes that are new in a store.
- * @author britt
- */
-public interface NewInAVMStore
-{
- /**
- * Get the AVMStore part.
- * @return The AVMStore
- */
- public AVMStore getAvmStore();
-
- /**
- * Get the node part.
- * @return The AVMNode.
- */
- public AVMNode getNode();
-}
diff --git a/source/java/org/alfresco/repo/avm/NewInAVMStoreDAO.java b/source/java/org/alfresco/repo/avm/NewInAVMStoreDAO.java
deleted file mode 100644
index b5ecee1017..0000000000
--- a/source/java/org/alfresco/repo/avm/NewInAVMStoreDAO.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2006 Alfresco, Inc.
- *
- * Licensed under the Mozilla Public License version 1.1
- * with a permitted attribution clause. You may obtain a
- * copy of the License at
- *
- * http://www.alfresco.org/legal/license.txt
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the
- * License.
- */
-
-package org.alfresco.repo.avm;
-
-import java.util.List;
-
-/**
- * DAO for NewInAVMStore markers.
- * @author britt
- */
-public interface NewInAVMStoreDAO
-{
- /**
- * Save one.
- * @param newEntry The item to save.
- */
- public void save(NewInAVMStore newEntry);
-
- /**
- * Get one by Node.
- * @param node The node to lookup with.
- * @return The Entry or null if not found.
- */
- public NewInAVMStore getByNode(AVMNode node);
-
- /**
- * Get all that are in the given store.
- * @param store The AVMStore.
- * @return A List of NewInAVMStores.
- */
- public List getByAVMStore(AVMStore store);
-
- /**
- * Delete the given entry.
- * @param newEntry The entry to delete.
- */
- public void delete(NewInAVMStore newEntry);
-}
diff --git a/source/java/org/alfresco/repo/avm/NewInAVMStoreImpl.java b/source/java/org/alfresco/repo/avm/NewInAVMStoreImpl.java
deleted file mode 100644
index bd122f9bf5..0000000000
--- a/source/java/org/alfresco/repo/avm/NewInAVMStoreImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2006 Alfresco, Inc.
- *
- * Licensed under the Mozilla Public License version 1.1
- * with a permitted attribution clause. You may obtain a
- * copy of the License at
- *
- * http://www.alfresco.org/legal/license.txt
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the
- * License.
- */
-
-package org.alfresco.repo.avm;
-
-import java.io.Serializable;
-
-/**
- * A record of a node that is new and in which store it resides.
- * @author britt
- */
-class NewInAVMStoreImpl implements NewInAVMStore, Serializable
-{
- private static final long serialVersionUID = 1905996612150732182L;
-
- /**
- * The Primary Key.
- */
- private Long fID;
-
- /**
- * The AVMStore.
- */
- private AVMStore fAVMStore;
-
- /**
- * The Node.
- */
- private AVMNode fNode;
-
- /**
- * Default constructor.
- */
- public NewInAVMStoreImpl()
- {
- }
-
- /**
- * Make a new one.
- * @param store The store.
- * @param node The AVMNode that is new.
- */
- public NewInAVMStoreImpl(AVMStore store, AVMNode node)
- {
- fAVMStore = store;
- fNode = node;
- }
-
- /**
- * @return the fNode
- */
- public AVMNode getNode()
- {
- return fNode;
- }
-
- /**
- * @param node the fNode to set
- */
- public void setNode(AVMNode node)
- {
- fNode = node;
- }
-
- /**
- * @return the store
- */
- public AVMStore getAvmStore()
- {
- return fAVMStore;
- }
-
- /**
- * @param store the AVMStore to set
- */
- public void setAvmStore(AVMStore store)
- {
- fAVMStore = store;
- }
-
- /**
- * Set the primary key. (For Hibernate)
- * @param id The primary key.
- */
- protected void setId(Long id)
- {
- fID = id;
- }
-
- /**
- * Get the primary key. (For Hibernate)
- * @return The primary key.
- */
- protected Long getId()
- {
- return fID;
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (this == other)
- {
- return true;
- }
- if (!(other instanceof NewInAVMStore))
- {
- return false;
- }
- NewInAVMStore o = (NewInAVMStore)other;
- return fAVMStore.equals(o.getAvmStore()) &&
- fNode.equals(o.getNode());
- }
-
- @Override
- public int hashCode()
- {
- return fAVMStore.hashCode() + fNode.hashCode();
- }
-}
-
diff --git a/source/java/org/alfresco/repo/avm/OrphanReaper.java b/source/java/org/alfresco/repo/avm/OrphanReaper.java
index 4b81ac86df..1634c8dbe8 100644
--- a/source/java/org/alfresco/repo/avm/OrphanReaper.java
+++ b/source/java/org/alfresco/repo/avm/OrphanReaper.java
@@ -275,11 +275,6 @@ public class OrphanReaper implements Runnable
link.getMto().setMergedFrom(ancestor);
AVMContext.fgInstance.fMergeLinkDAO.delete(link);
}
- NewInAVMStore newInRep = AVMContext.fgInstance.fNewInAVMStoreDAO.getByNode(node);
- if (newInRep != null)
- {
- AVMContext.fgInstance.fNewInAVMStoreDAO.delete(newInRep);
- }
// Get rid of all properties belonging to this node.
AVMContext.fgInstance.fAVMNodePropertyDAO.deleteAll(node);
// Get rid of all aspects belonging to this node.
diff --git a/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java b/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java
index 95c9082271..c6b404173f 100644
--- a/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java
+++ b/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java
@@ -44,7 +44,6 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
super(store.getAVMRepository().issueID(), store);
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
}
/**
@@ -73,7 +72,6 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
AVMContext.fgInstance.fChildEntryDAO.save(newChild);
}
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
copyProperties(other);
}
diff --git a/source/java/org/alfresco/repo/avm/PlainFileNodeImpl.java b/source/java/org/alfresco/repo/avm/PlainFileNodeImpl.java
index efaa152e1b..2302a7f000 100644
--- a/source/java/org/alfresco/repo/avm/PlainFileNodeImpl.java
+++ b/source/java/org/alfresco/repo/avm/PlainFileNodeImpl.java
@@ -73,7 +73,6 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
// AVMContext.fgInstance.fAVMNodeDAO.flush();
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
}
/**
@@ -90,7 +89,6 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
setContentData(other.getContentData(null));
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
copyProperties(other);
}
@@ -112,7 +110,6 @@ class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
AVMContext.fgInstance.fAVMNodeDAO.save(this);
AVMContext.fgInstance.fAVMNodeDAO.flush();
this.setProperties(props);
- AVMContext.fgInstance.fNewInAVMStoreDAO.save(new NewInAVMStoreImpl(store, this));
}
/**
diff --git a/source/java/org/alfresco/repo/avm/hibernate/AVM.hbm.xml b/source/java/org/alfresco/repo/avm/hibernate/AVM.hbm.xml
index 28c6016a34..3fc8f8b30c 100644
--- a/source/java/org/alfresco/repo/avm/hibernate/AVM.hbm.xml
+++ b/source/java/org/alfresco/repo/avm/hibernate/AVM.hbm.xml
@@ -41,6 +41,7 @@
+
@@ -161,14 +162,6 @@
-
-
-
-
-
-
-
-
@@ -240,10 +233,10 @@
where ce.parent = :parent
]]>
-
+
diff --git a/source/java/org/alfresco/repo/avm/hibernate/AVMNodeDAOHibernate.java b/source/java/org/alfresco/repo/avm/hibernate/AVMNodeDAOHibernate.java
index b03368425d..86079dbd2a 100644
--- a/source/java/org/alfresco/repo/avm/hibernate/AVMNodeDAOHibernate.java
+++ b/source/java/org/alfresco/repo/avm/hibernate/AVMNodeDAOHibernate.java
@@ -146,6 +146,19 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
return (List)query.list();
}
+ /**
+ * Get all AVMNodes that are new in the given store.
+ * @param store The given store.
+ * @return A List of AVMNodes.
+ */
+ @SuppressWarnings("unchecked")
+ public List getNewInStore(AVMStore store)
+ {
+ Query query = getSession().getNamedQuery("AVMNode.GetNewInStore");
+ query.setEntity("store", store);
+ return (List)query.list();
+ }
+
/**
* Inappropriate hack to get Hibernate to play nice.
*/
diff --git a/source/java/org/alfresco/repo/avm/hibernate/NewInAVMStoreDAOHibernate.java b/source/java/org/alfresco/repo/avm/hibernate/NewInAVMStoreDAOHibernate.java
deleted file mode 100644
index 6bfbe516c7..0000000000
--- a/source/java/org/alfresco/repo/avm/hibernate/NewInAVMStoreDAOHibernate.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2006 Alfresco, Inc.
- *
- * Licensed under the Mozilla Public License version 1.1
- * with a permitted attribution clause. You may obtain a
- * copy of the License at
- *
- * http://www.alfresco.org/legal/license.txt
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the
- * License.
- */
-
-package org.alfresco.repo.avm.hibernate;
-
-import java.util.List;
-
-import org.alfresco.repo.avm.AVMNode;
-import org.alfresco.repo.avm.AVMStore;
-import org.alfresco.repo.avm.NewInAVMStore;
-import org.alfresco.repo.avm.NewInAVMStoreDAO;
-import org.hibernate.Query;
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
-
-/**
- * Hibernate implementation of NewInAVMStore DAO.
- * @author britt
- */
-class NewInAVMStoreDAOHibernate extends HibernateDaoSupport implements
- NewInAVMStoreDAO
-{
- /**
- * Save one.
- * @param newEntry The item to save.
- */
- public void save(NewInAVMStore newEntry)
- {
- getSession().save(newEntry);
- }
-
- /**
- * Get one by Node.
- * @param node The node to lookup with.
- * @return The Entry or null if not found.
- */
- public NewInAVMStore getByNode(AVMNode node)
- {
- Query query = getSession().createQuery("from NewInAVMStoreImpl nie where nie.node = :node");
- query.setEntity("node", node);
- return (NewInAVMStore)query.uniqueResult();
- }
-
- /**
- * Get all that are in the given store.
- * @param store The AVMStore.
- * @return A List of NewInAVMStores.
- */
- @SuppressWarnings("unchecked")
- public List getByAVMStore(AVMStore store)
- {
- Query query = getSession().createQuery("from NewInAVMStoreImpl nie where nie.avmStore = :store");
- query.setEntity("store", store);
- return (List)query.list();
- }
-
- /**
- * Delete the given entry.
- * @param newEntry The entry to delete.
- */
- public void delete(NewInAVMStore newEntry)
- {
- getSession().delete(newEntry);
- }
-}