I'am using Hibernate-3.2.0.ga under Spring container 2.0
I'have configured a listners in spring Application_context
And and just to see if it works i wrote this Listner
HibernateEventListener implements SaveOrUpdateEventListener {
public void onSaveOrUpdate(SaveOrUpdateEvent event)
throws HibernateException {
final SessionImplementor source = event.getSession();
final Object o = event.getObject();
final Object entity = source.getPersistenceContext()
.unproxyAndReassociate(o);
System.out.println("PersistEvent(SaveOrUpdateEvent)"+ entity.getClass().getName());
}
as test i' habe listed objects without any changes and a Listner was Notified ...
so I 'have a contract which is in relation one-to-one with a Scope
and when i list a contracts i get a Notification that scope was changed!
That 's strange ....
and if i change a Relation without cascading than it works properly something is Wrong ...
can someone help me?
Many Thx in advance ..
The mapping :
<!-- uni-directional one-to-one association to Scope -->
<many-to-one name="scope" class="de.domain.Scope" column="ScopeId" cascade="all" access="field"/>
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html