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

Manipulating entities using the shell alters user-defined annotations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.5.RELEASE
    • Fix Version/s: 1.2.4.RELEASE
    • Component/s: @ CORE, @ ROO SHELL
    • Labels:
      None

      Description

      Detailed test case:

      Execute the following commands:

      project --topLevelPackage finders --projectName finders
      jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
      entity jpa --class ~.SampleEntity
      field string --fieldName fieldene
      field string --fieldName fieldTwo
      class --class ~.util.Constants --abstract

      Add 'public static final String FIELD = "fieldOne"' to finders.util.Constants
      Add 'import static finders.util.Constants.FIELD;' to finder.SampleEntity
      Add 'import javax.persistence.*' to finders.SampleEntity
      Annotate finder.SampleEntity with '@Table(name = FIELD, uniqueConstraints = @UniqueConstraint(columnNames =

      {"field_one", "field_two"}

      ))'
      Execute the command: 'finder add --class ~.SampleEntity --finderName findSampleEntitysByFieldOne'
      @Table annotation becomes '@Table(name = unknown.Object.FIELD, uniqueConstraints = @finders.UniqueConstraint(

      { "field_one", "field_two" }

      ))' (EXPECTED: no changes made)

      The same happens when a field is added to the entity (I suspect any modification will produce the above issue, probably it is not limited to entities, either).

      Note that the FIELD and UniqueConstraints do not become corrupted if they are already fully qualified prior to 'finder add ...'; however, 'columnNames = ... ' still disappears.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            crizzis Krzysztof Sierszeń
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2d
                2d
                Remaining:
                Remaining Estimate - 2d
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified