3 Replies Latest reply on May 3, 2016 3:03 PM by jjfraney

    jpa new entity extension: alternate names for @Id and @Version properties

    jjfraney

      Forge 3.1.0:

       

      What paths for extension are available to get forge to generate different names for @Id and @Version properties?  In our development shop, we use a surrogate key for @Id and use the name 'sid' instead of 'id' for the property.  We also use 'rowVersion' not 'version' for the @Version property.

       

      I'd also like to identify a property as the natural id of the entity.  This is a different kind of extension than simply using an alternate name.

       

      Looks like the jpa new entity command has these hardwired to 'id' and 'version' (See: org.jboss.forge.addon.javaee.jpa.PersistenceOperationsImpl.createJavaEntityClass(String, String, GenerationType, String) )

       

      I think I have to create my own ui command in my own addon.  If so,

       

      1) Can I rebind 'jpa-new-entity' to my new ui command object?

       

      2) What extension points are there in the current jpa-new-entity command that I may customize it?  I think none, and I'll have to copy out the jpa-new-entity command into my own addon project, then modify it.

       

      Thanks,

      John