XMLWordPrintable

Details

    • Sub-task
    • Resolution: Duplicate
    • Major
    • 2.x Future
    • 2.14.0.Final
    • Java EE
    • None

    Description

      It would be good to have a command to create an Entity Listener. A command like this :

      cdi-new-entity-listener --named MyListener ;
      

      Would generate by default in the model package :

      public class MyListener
      {
      }
      

      Nothing too fancy, but the command could propose a list of events and generate a method per event :

      cdi-new-entity-listener --named MyListener --events PRE_PERSIST POST_PERSIST PRE_UPDATE ;
      
      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.");
         }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: