[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2007) new-entity and generate-entities don't use same package name

Dan Allen (JIRA) jira-events at lists.jboss.org
Sun Sep 30 00:00:41 EDT 2007

    [ http://jira.jboss.com/jira/browse/JBSEAM-2007?page=comments#action_12379457 ] 
Dan Allen commented on JBSEAM-2007:

I am open to going the other way, making new-entity put classes in the model package. However, it just seems less appropriate.

> new-entity and generate-entities don't use same package name
> ------------------------------------------------------------
>                 Key: JBSEAM-2007
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2007
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.0.0.CR1
>            Reporter: Dan Allen
>             Fix For: 2.0.0.GA
>         Attachments: JBSEAM-2007-v1.txt
>   Original Estimate: 30 minutes
>  Remaining Estimate: 30 minutes
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list