That did the trick! Many thanks!

Bob


Michael Horwitz wrote:
> 
> On 7/31/07, syg6 <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hello,
>>
>> I copied into WEB-INF and then deleted the applicationContext-dao.xml
>> that
>> comes in resources (I 'exploded' Appfuse source into my project) and
>> added
>> the following mapping:
>>
>> <bean id="sessionFactory" ...>
>> <property name="eventListeners">
>>    <map>
>>      <entry key="save-update"><ref local="saveOrUpdateListener"
>> /></entry>
>>    </map>
>> </property>
>> </bean>
>> <bean id="saveOrUpdateListener"
>> class="com.mycompany.myapp.dao.SaveOrUpdateListener" />
>>
>> The class, SaveOrUpdateListener, extends the Hibernate
>> DefaultSaveOrUpdateEventListener,  and for the moment does nothing more
>> than
>> a System.out. But it's only being called when I save or update the User
>> object. The only other object I have for the moment is Person, and it's
>> just
>> a POJO, it doesn't have its own DAO or Manager. Could this be the reason
>> why
>> my EventListener is not being called?
> 
> 
> Yas and no. Yes in that your listener is not being called because you are
> using the Generic DAO. No in that you don't need to implement a specific
> DAO
> to solve the problem. See below.
> 
> Mind you, most of my objects will have DAOs and Managers, but many will be
>> simple POJOs that rely on GenericDaoHibernate and GenericManagerImpl for
>> CRUD. The EventListener should be being called, no?
> 
> 
> Yes, but there is a catch here. The Generic DAO calls merge, whereas the
> UserDAO call saveOrUpdate on the Hibernate session. So you will see
> activity
> on the User object. If you want your listener to pick up events for
> objects
> going through the Generic DAO you will also need to extend/implement the
> MergeEventListener.
> 
> Mike.
> 
> Thanks!
>> Bob
>>
>> --
>> View this message in context:
>> http://www.nabble.com/EventListener-only-firing-on-User-object--tf4191374s2369.html#a11919503
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/EventListener-only-firing-on-User-object--tf4191374s2369.html#a11920536
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to