mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added hashCode(), equals(), toString() in various places. Fixed delete logic.
Added some missing bean references. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5513 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,10 +25,14 @@
|
||||
|
||||
package org.alfresco.repo.attributes.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.attributes.Attribute;
|
||||
import org.alfresco.repo.attributes.AttributeDAO;
|
||||
import org.alfresco.repo.attributes.GlobalAttributeEntry;
|
||||
import org.alfresco.repo.attributes.GlobalAttributeEntryDAO;
|
||||
import org.alfresco.repo.attributes.GlobalAttributeEntryImpl;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
||||
/**
|
||||
@@ -38,12 +42,25 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
public class GlobalAttributeEntryDAOHibernate extends HibernateDaoSupport
|
||||
implements GlobalAttributeEntryDAO
|
||||
{
|
||||
private AttributeDAO fAttributeDAO;
|
||||
|
||||
public GlobalAttributeEntryDAOHibernate()
|
||||
{
|
||||
}
|
||||
|
||||
public void setAttributeDao(AttributeDAO dao)
|
||||
{
|
||||
fAttributeDAO = dao;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.attributes.GlobalAttributeEntryDAO#delete(org.alfresco.repo.attributes.GlobalAttributeEntry)
|
||||
*/
|
||||
public void delete(GlobalAttributeEntry entry)
|
||||
{
|
||||
Attribute attr = entry.getAttribute();
|
||||
getSession().delete(entry);
|
||||
fAttributeDAO.delete(attr);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -69,4 +86,14 @@ public class GlobalAttributeEntryDAOHibernate extends HibernateDaoSupport
|
||||
{
|
||||
getSession().save(entry);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.attributes.GlobalAttributeEntryDAO#getKeys()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<String> getKeys()
|
||||
{
|
||||
Query query = getSession().createQuery("select gae.name from GlobalAttributeEntryImpl gae");
|
||||
return (List<String>)query.list();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user