Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1721

Adding a field to MyEntity.java confuses roo

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 1.1.0.RELEASE
    • 1.1.1.RELEASE
    • GENERAL OBJECTS, WEB MVC
    • None

    Description

      Several sibling Controllers' Converters were re-written to show just the new field.
      and _Roo_DataOnDemand.aj also re-written to use just the new field.

      First I added a field to MyEntity.java:
      private String email2;
      (Roo generated MyEntity_JavaBean.aj, and made other adjustments to views, etc.)

      Then I realized this field is transient:
      private transient email2;

      Roo removes the MyEntity_Roo_JavaBean.aj, so I add my own get/set methods:
      transient private String email2;
      public String getEmail2()

      { return this.email2; }

      public void setEmail2(String email2)

      { this.email2 = email2; }

      When I finally commit to svn, i see the Converters and test/.../MyEntityDataOnDemand are toast.

      Note: only one field left in DoD: (the transient)

      public MyEntity MyEntityDataOnDemand.getNewTransientMyEntity(int index)

      { my.pkg.MyEntity obj = new my.pkg.MyEntity(); obj.setEmail2("email2_" + index); return obj; }

      OtherController_Roo_Controller.aj:
      Converter<MyEntity, String> OtherController.getMyEntityConverter() {
      return new Converter<MyEntity, String>() {
      public String convert(MyEntity myEntity)

      { return new StringBuilder().append(myEntity.getEmail2()).toString(); }

      };
      }

      Attachments

        Activity

          People

            sschmidt Stefan Schmidt
            jpunt Jack Punt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: