1 Reply Latest reply on May 22, 2009 12:38 AM by Arbi Sookazian

    EL Genereated Incorectly by JBoss Tools (or SeamGen)

    Michael Angelo Newbie

      I have a database with tables that are named badly. The name format is:


      {char}_{table name}


      In the list page, for example, here is a code snippet that is generated:


                  <s:decorate template="layout/display.xhtml">
                      <ui:define name="label">U widget name</ui:define>
                      <h:inputText id="UWidgetName" value="#{uWidgetList.uWidget.UWidgetName}"/>
                  </s:decorate>
      
                  <s:decorate template="layout/display.xhtml">
                      <ui:define name="label">Widget desc</ui:define>
                      <h:inputText id="widgetDesc" value="#{uWidgetList.uWidget.widgetDesc}"/>
                  </s:decorate>
      



      The reference to uWidget should be UWidget if u_widget is a table in the database. I did a test with some columns and named them in a similar fashion. Those get generated correctly in the EL.


      Is this a bug or can I do something about this? There is way too much for a search / replace manual fix.


      Thanks

        • 1. Re: EL Genereated Incorectly by JBoss Tools (or SeamGen)
          Arbi Sookazian Master

          you will most likely need to modify seam-gen.reveng.xml and/or the Freemarker templates.


          from SiA:



          If you’re still not pleased with the classes that the reverse-engineering tool creates,
          you can further customize them by modifying the FreeMarker templates used to construct
          them. Hibernate includes an entire reverse-engineering API that you can tap
          into during this process. The templates it uses reside in the seam-gen/pojo directory.
          There, you’ll find a small set of customizations to support the seam-gen tasks. Hibernate
          falls back on its own default template if the one it’s looking for is not present in
          this directory.

          specifically, check this out:  \%SEAM_HOME%\seam-gen\view\list.xhtml.ftl