Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2007

new-entity and generate-entities don't use same package name

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.0.CR1
    • Fix Version/s: 2.0.0.CR2
    • Component/s: Tools
    • Labels:
      None
    • Estimated Difficulty:
      Low

      Description

      The *Home.java and *List.java classes that are produced by new-entity do not use the same package as the same classes produced by generate-entities.

      Assuming the entity name is MyEntity, here is how the two actions play out.

      new-entity:

      src/action/com/company/action/MyEntityHome.java
      src/action/com/company/action/MyEntityList.java

      generate-entities:

      src/action/com/company/model/MyEntityHome.java
      src/action/com/company/model/MyEntityList.java

      Notice that generate-entities uses "model" while the new-entity uses "action".

      This behavior is due to a limitation in the hbmtemplate task which assumes that the Java files created will be in the same package as the model. However, it is possible to work around this problem. I have created such a patch. I believe that new-entity exhibits the correct behavior and puts the classes in the expected location.

      The only limitation of doing this patch is that it is necessary to use a star import for the model classes since the hbmtemplate task assumes the current package is the package of the entity (hence even pojo.importType() wouldn't work). However, this shouldn't really be an issue since the IDE can cleanup the star imports. I would much rather have the consistency of the same package. Besides, *List.java and *Home.java are action components, not models.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dan.j.allen Dan Allen
                Reporter:
                dan.j.allen Dan Allen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 30 minutes
                  30m
                  Remaining:
                  Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified