Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Works as Designed
    • Affects Version/s: 1.1.4.RELEASE
    • Fix Version/s: None
    • Component/s: WEB MVC
    • Environment:

      Description

      Looks like enitities fields defined out of the .java file are not eligible when Roo creates web scaffold.

      The attached zip contains a project with 2 entities created via DBRE. When command "web mvc all" is launched Roo doesn't create the JSPx (create, update, list, show) for one of the entities (the one with Id field in .java and several fields in DBManajed.aj) and for the other entity the JSPx only includes fields defined in .java, but it should to include other fields annotated with JPA annotations.

        Activity

        Hide
        Alan Stewart added a comment - - edited

        This is working as DBRE was designed and has nothing to do with your pushed in field in one of the entities.

        Your project does not have the dbre.xml file anymore but this file is required by Roo during startup to be able to introduce fields and methods to the db_managed ITD. You also have automaticallyDelete set to false which will help prevent the deletion of the db-managed entity and thus the ITD. By not having the dbre.xml present, the fields and methods are not added to the MemberDetails and thus will not be available to be scaffolded.

        DBRE was designed to introduce fields via an ITD instead of the .java file so that Roo can easily manage the addition and deletion of fields when table columns are added and deleted respectively.

        To work around your issue, either push in all the fields from the db-managed ITD into the the .java file (thus triggering the creation the accessors and mutators in the javabean ITD) or restore the dbre.xml file.

        You can raise an improvement request to have the behaviour changed in DBRE so that fields are introduced to the .java file, however, as you can appreciate, this is a major change and certainly won't be done for 1.1.5.

        Show
        Alan Stewart added a comment - - edited This is working as DBRE was designed and has nothing to do with your pushed in field in one of the entities. Your project does not have the dbre.xml file anymore but this file is required by Roo during startup to be able to introduce fields and methods to the db_managed ITD. You also have automaticallyDelete set to false which will help prevent the deletion of the db-managed entity and thus the ITD. By not having the dbre.xml present, the fields and methods are not added to the MemberDetails and thus will not be available to be scaffolded. DBRE was designed to introduce fields via an ITD instead of the .java file so that Roo can easily manage the addition and deletion of fields when table columns are added and deleted respectively. To work around your issue, either push in all the fields from the db-managed ITD into the the .java file (thus triggering the creation the accessors and mutators in the javabean ITD) or restore the dbre.xml file. You can raise an improvement request to have the behaviour changed in DBRE so that fields are introduced to the .java file, however, as you can appreciate, this is a major change and certainly won't be done for 1.1.5.
        Hide
        Oscar Rovira (DiSiD) added a comment -

        Thanks Alan,
        so, more or less, in DBRE, dbre.xml is the file holding data to build Metadata of reverse engineered Entities. Is there any reason why, in case that DBManaged exists, Roo doesn't take this ITD for generate the MemeberDetails?

        Show
        Oscar Rovira (DiSiD) added a comment - Thanks Alan, so, more or less, in DBRE, dbre.xml is the file holding data to build Metadata of reverse engineered Entities. Is there any reason why, in case that DBManaged exists, Roo doesn't take this ITD for generate the MemeberDetails?
        Hide
        Alan Stewart added a comment - - edited

        DBRE is one of the very few cases where fields are introduced directly into the ITD (others are @Id and @Version fields in EntityMetadata). Roo doesn't parse ITDs and if the dbre.xml file is not found, the metadata item is not built and added as a MemberHoldingTypeDetails in MemberDetails.

        I will look at this further for 1.2.0 - there probably is a way of doing this, as it's not something I've been particularly satisfied with anyway.

        Show
        Alan Stewart added a comment - - edited DBRE is one of the very few cases where fields are introduced directly into the ITD (others are @Id and @Version fields in EntityMetadata). Roo doesn't parse ITDs and if the dbre.xml file is not found, the metadata item is not built and added as a MemberHoldingTypeDetails in MemberDetails. I will look at this further for 1.2.0 - there probably is a way of doing this, as it's not something I've been particularly satisfied with anyway.

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Oscar Rovira (DiSiD)
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: