mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Interim checkin for ListAttribute support.
Should fix build breakage also. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5551 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,6 +33,8 @@ import java.util.Map;
|
||||
import org.alfresco.repo.attributes.AttrQueryHelperImpl;
|
||||
import org.alfresco.repo.attributes.Attribute;
|
||||
import org.alfresco.repo.attributes.AttributeDAO;
|
||||
import org.alfresco.repo.attributes.ListAttribute;
|
||||
import org.alfresco.repo.attributes.ListEntryDAO;
|
||||
import org.alfresco.repo.attributes.MapAttribute;
|
||||
import org.alfresco.repo.attributes.MapEntry;
|
||||
import org.alfresco.repo.attributes.MapEntryDAO;
|
||||
@@ -52,6 +54,8 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
{
|
||||
private MapEntryDAO fMapEntryDAO;
|
||||
|
||||
private ListEntryDAO fListEntryDAO;
|
||||
|
||||
public AttributeDAOHibernate()
|
||||
{
|
||||
}
|
||||
@@ -61,6 +65,11 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
fMapEntryDAO = dao;
|
||||
}
|
||||
|
||||
public void setListEntryDao(ListEntryDAO dao)
|
||||
{
|
||||
fListEntryDAO = dao;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.attributes.AttributeDAO#delete(org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
@@ -76,6 +85,19 @@ public class AttributeDAOHibernate extends HibernateDaoSupport implements
|
||||
delete(subAttr);
|
||||
}
|
||||
}
|
||||
if (attr.getType() == Type.LIST)
|
||||
{
|
||||
List<Attribute> children = new ArrayList<Attribute>();
|
||||
for (Attribute child : attr)
|
||||
{
|
||||
children.add(child);
|
||||
}
|
||||
fListEntryDAO.delete((ListAttribute)attr);
|
||||
for (Attribute child : children)
|
||||
{
|
||||
delete(child);
|
||||
}
|
||||
}
|
||||
getSession().delete(attr);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user