[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-288) Execute the EJB 3.0 callback on collection change

Hardy Ferentschik (JIRA) noreply at atlassian.com
Wed Jul 23 06:34:13 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30713 ] 

Hardy Ferentschik commented on EJB-288:
---------------------------------------

Added the collection post update event listeners. There is a remaining questions though regarding 'de-duplication' of events. For example, a Cat has a collection of Kittens:

class Cat {
       ...
	@OneToMany(cascade = CascadeType.ALL)
	public List<Kitten> getKittens() {
		return kittens;
	}

       	@PostUpdate
	private void someLateUpdateWorking() {
            ...
	}
      ...

If we now load a persisted Cat instance with a set of Kittens and replace the kittens:

   cat.setKittens(new ArrayList<Kitten>());

the post update handler will be called twice since Hibernate core will fire a PostCollectionRemoveEvent and PostCollectionRecreateEvent. In entity manager there is no way currently to 'de-duplicate'  these two events. Does this violate the JPA spec? Is there a way in core to only trigger one event?


> Execute the EJB 3.0 callback on collection change
> -------------------------------------------------
>
>                 Key: EJB-288
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-288
>             Project: Hibernate Entity Manager
>          Issue Type: Improvement
>          Components: EntityManager
>    Affects Versions: 3.3.2.GA
>            Reporter: Emmanuel Bernard
>            Assignee: Hardy Ferentschik
>             Fix For: 3.4.0.CR2
>
>
> Today collection change does not trigger an event, but we it will, it makes sense to trigger the ejb 3 lifecycle (minus calling it twice??).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list