I did but had an exception with it. I had to modify the sources of
hibernate and recompile it to make it work with mdarad.
The problem was located in the source code of the class
org.hibernate.mapping.Collection in the method getComparator(). The
highlighted portion of the following code was comparator!=null
and prevented from returning a valid comparator.
public Comparator getComparator() {
if(comparator==null &&
comparatorClassName!=null) {
try {
setComparator( (Comparator) ReflectHelper.classForName(
comparatorClassName ).newInstance() );
}
catch (Exception e) {
throw new MappingException( "Could not instantiate
comparator class: "
+ comparatorClassName + " for collection " +
getRole() );
}
}
return comparator;
}
If you have any questions, contact me.
Philippe
François Eric wrote:
I've seen a few threads of hibernate on this and some seem to suggest
to move to hibernate 3.1 (that is still in release candidate 2).
Phil I think you tried to merge to hibernate 3 no? Any problems?
François
François Eric wrote:
I just found a bug that I hadn't seen before and want to know if you
guys have noticed it.
In any application started with StartTemplate.zuml (so with the default
Logins) I get the following error when trying to add a LoginRole to a
newly created LoginGroup:
10:29:44,957 INFO [STDOUT] Caused by:
org.mdarad.framework.dao.DAOException:
org.hibernate.TransientObjectException: object
references an unsaved transient instance - save the transient instance
before flushing: org.mdarad.authentication.entities.Lo
ginRole
10:29:44,957 INFO [STDOUT] at
org.mdarad.authentication.dao.LoginGroupDAO.saveLoginGroup(LoginGroupDAO.java:72)
10:29:44,957 INFO [STDOUT] at
org.mdarad.authentication.facades.LoginGroupBusinessObjectFacadeBase.saveLoginGroup(LoginG
roupBusinessObjectFacadeBase.java:69)
10:29:44,957 INFO [STDOUT] ... 63 more
10:29:44,957 INFO [STDOUT] Caused by:
org.hibernate.TransientObjectException: object references an unsaved
transient instanc
e - save the transient instance before flushing:
org.mdarad.authentication.entities.LoginRole
10:29:44,957 INFO [STDOUT] at
org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:210)
10:29:44,957 INFO [STDOUT] at
org.hibernate.type.EntityType.getIdentifier(EntityType.java:80)
10:29:44,957 INFO [STDOUT] at
org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:51)
10:29:44,957 INFO [STDOUT] at
org.hibernate.collection.AbstractCollectionPersister.writeElement(AbstractCollectionPersis
ter.java:622)
10:29:44,957 INFO [STDOUT] at
org.hibernate.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.
java:838)
10:29:44,957 INFO [STDOUT] at
org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:23)
10:29:44,957 INFO [STDOUT] at
org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
10:29:44,957 INFO [STDOUT] at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
10:29:44,957 INFO [STDOUT] at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
10:29:44,967 INFO [STDOUT] at
org.hibernate.event.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventL
istener.java:271)
10:29:44,967 INFO [STDOUT] at
org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:24)
10:29:44,967 INFO [STDOUT] at
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:719)
10:29:44,967 INFO [STDOUT] at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:84)
10:29:44,967 INFO [STDOUT] at
org.mdarad.authentication.dao.LoginGroupDAO.saveLoginGroup(LoginGroupDAO.java:66)
10:29:44,967 INFO [STDOUT] ... 64 more
Do any of you why I am getting this? I will open a bug.
François
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.2/170 - Release Date: 11/15/2005
|
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.2/170 - Release Date: 15/11/2005