| actually usable entity events [message #1012227] |
Thu, 21 February 2013 01:15  |
Tom Eugelink Messages: 801 Registered: July 2009 |
Senior Member |
|
|
I've just embarked on a new project where we will be using JPA. One of the issues that I came across in previous projects is the fact that the EJB events are not really usable, because you often need to modify other entities and that is not supported. I've tried to find out if the events are going to be improved in a future JPA spec, but I cannot find an answer. But maybe the guys implementing the reference implementation do.
So: are there JPA entity events planned in a future spec where you can modify / persist / remove other entities?
Tom
|
|
|
| Re: actually usable entity events [message #1014844 is a reply to message #1012227] |
Tue, 26 February 2013 10:15   |
James Sutherland Messages: 1844 Registered: July 2009 |
Senior Member |
|
|
I assume this will always be unspecified/provider specific in the Spec.
Depending on the event, and the modification, it may work.
EclipseLink also has its own set of SessionEvents and DescriptorEvents.
Somethings are better done in the application, instead of persistence events.
James : Wiki : Book : Blog
|
|
|
| Re: actually usable entity events [message #1014871 is a reply to message #1014844] |
Tue, 26 February 2013 11:09  |
Tom Eugelink Messages: 801 Registered: July 2009 |
Senior Member |
|
|
On 2013-02-26 16:15, James Sutherland wrote:
> I assume this will always be unspecified/provider specific in the Spec.
>
> Depending on the event, and the modification, it may work.
>
> EclipseLink also has its own set of SessionEvents and DescriptorEvents.
>
> Somethings are better done in the application, instead of persistence events.
>
Too bad. What would be great is that the events would be fired on all entities before they are written to the database. That would allow for changes being made to other entities.
I've initially indeed adopted Eclipse's events to do this, but ended up with an extended entity manager to generate them. Especially cascade remove is something that is hard to do in an application.
|
|
|
Powered by
FUDForum. Page generated in 0.01527 seconds