Point checkin. Hibernate is currently beating me up by not doing

what I expect when trying to determine the concrete type of a polymorphic
type.  Some major surgery seems to be in order.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2927 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-20 15:34:17 +00:00
parent 72751fdedb
commit 2ee957f5e2
7 changed files with 164 additions and 70 deletions

View File

@@ -99,6 +99,7 @@ public class RepositoryImpl implements Repository
fData.setRoot(rootBean);
fData.getRoots().put(fData.getNextVersionID(), rootBean);
fData.setNextVersionID(fData.getNextVersionID());
fSuper.getSession().save(fData);
}
/**

View File

@@ -142,6 +142,8 @@ public class SuperRepositoryImpl implements SuperRepository
// Newing up the object causes it to be written to the db.
@SuppressWarnings("unused")
Repository rep = new RepositoryImpl(this, name);
// Special handling for repository creation.
rep.getDataBean().getRoot().setIsNew(false);
}
/* (non-Javadoc)
@@ -485,7 +487,7 @@ public class SuperRepositoryImpl implements SuperRepository
*/
private Repository getRepositoryByName(String name)
{
Query query = fSession.createQuery("from repositories r where r.name = :name");
Query query = fSession.createQuery("from RepositoryBeanImpl r where r.name = :name");
query.setString("name", name);
return new RepositoryImpl(this, (RepositoryBean)query.uniqueResult());
}