]
Antonio Goncalves reassigned FORGE-2093:
----------------------------------------
Assignee: Antonio Goncalves
Being able to create a new JPA listener
---------------------------------------
Key: FORGE-2093
URL:
https://issues.jboss.org/browse/FORGE-2093
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.12.1.Final
Reporter: Antonio Goncalves
Assignee: Antonio Goncalves
Fix For: 2.x Future
It would be good to be able to create a new JPA listener. A basic command could just be
:
{code}
jpa-new-listener --named MyListener
{code}
This will generate the following code :
{code}
class MyListener {
}
{code}
Then we would add as many lifecycle events as needed, something like :
{code}
jpa-new-listener --named MyListener --lifecycle PRE_PERSIST, POST_UPDATE, POST_REMOVE
{code}
{code}
class MyListener {
@PrePersist
private void prePersist(Object object)
{
}
@PostUpdate
private void postUpdate(Object object)
{
}
@PostRemove
private void postRemove(Object object)
{
}
}
{code}