mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed test to flush session, avoiding unique constraint violation
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,6 +42,11 @@ public interface NodeDaoService
|
||||
*/
|
||||
public boolean isDirty();
|
||||
|
||||
/**
|
||||
* Flush the data changes to the persistence layer.
|
||||
*/
|
||||
public void flush();
|
||||
|
||||
/**
|
||||
* Fetch a list of all stores in the repository
|
||||
*
|
||||
|
@@ -117,6 +117,14 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
|
||||
return ((Boolean)getHibernateTemplate().execute(callback)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Just flushes the session
|
||||
*/
|
||||
public void flush()
|
||||
{
|
||||
getSession().flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #QUERY_GET_ALL_STORES
|
||||
*/
|
||||
@@ -337,7 +345,6 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
|
||||
assoc.setTypeQName(assocTypeQName);
|
||||
assoc.setIsPrimary(isPrimary);
|
||||
assoc.setQname(qname);
|
||||
// assoc.setIsArchived(false);
|
||||
assoc.buildAssociation(parentNode, childNode);
|
||||
// persist
|
||||
getHibernateTemplate().save(assoc);
|
||||
@@ -450,7 +457,6 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
|
||||
{
|
||||
NodeAssoc assoc = new NodeAssocImpl();
|
||||
assoc.setTypeQName(assocTypeQName);
|
||||
// assoc.setIsArchived(false);
|
||||
assoc.buildAssociation(sourceNode, targetNode);
|
||||
// persist
|
||||
getHibernateTemplate().save(assoc);
|
||||
|
Reference in New Issue
Block a user