]
Antonio Goncalves closed FORGE-2227.
------------------------------------
Resolution: Duplicate Issue
Duplicates FORGE-2093
Being able to create a new Entity Listener
------------------------------------------
Key: FORGE-2227
URL:
https://issues.jboss.org/browse/FORGE-2227
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
It would be good to have a command to create an Entity Listener. A command like this :
{code}
cdi-new-entity-listener --named MyListener ;
{code}
Would generate by default in the {{model}} package :
{code}
public class MyListener
{
}
{code}
Nothing too fancy, but the command could propose a list of events and generate a method
per event :
{code}
cdi-new-entity-listener --named MyListener --events PRE_PERSIST POST_PERSIST PRE_UPDATE
;
{code}
{code}
public class MyListener
{
@PrePersist
private void prePersist(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@PostPersist
private void postPersist(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@PreUpdate
private void preUpdate(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}