mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
AVM stores are renamable. Beware. Database schema has changed since I needed to
introduce a synthetic primary key into the stores table. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4492 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -104,8 +104,11 @@
|
||||
<class table="avm_stores" name="AVMStoreImpl"
|
||||
proxy="AVMStore" optimistic-lock="version">
|
||||
<cache usage="read-write"/>
|
||||
<id name="name" column="name" type="string"/>
|
||||
<id name="id" column="id" type="long">
|
||||
<generator class="native"/>
|
||||
</id>
|
||||
<version name="vers" column="vers" type="long"/>
|
||||
<property name="name" column="name" type="string" unique="true"/>
|
||||
<property type="int" name="nextVersionID"
|
||||
column="next_version_id" not-null="true"/>
|
||||
<!-- Every AVMStore has a root directory that is the current root directory. -->
|
||||
|
@@ -77,7 +77,10 @@ class AVMStoreDAOHibernate extends HibernateDaoSupport implements
|
||||
*/
|
||||
public AVMStore getByName(String name)
|
||||
{
|
||||
return (AVMStore)getSession().get(AVMStoreImpl.class, name);
|
||||
Query query = getSession().createQuery("from AVMStoreImpl st " +
|
||||
"where st.name = :name");
|
||||
query.setParameter("name", name);
|
||||
return (AVMStore)query.uniqueResult();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,4 +104,12 @@ class AVMStoreDAOHibernate extends HibernateDaoSupport implements
|
||||
{
|
||||
// No op in Hibernate.
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMStoreDAO#getByID(long)
|
||||
*/
|
||||
public AVMStore getByID(long id)
|
||||
{
|
||||
return (AVMStore)getSession().get(AVMStoreImpl.class, id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user