Spring Roo
  1. Spring Roo
  2. ROO-3040

json itd creating incorrect code in controller_json.aj file when Entity Id field is not named "id"

    Details

      Description

      When creating a JSON-ed Controller for a JSON-ed Entity where the @Id field is not named "id", the controller_roo_controller_json.aj file creates invalid code. I have attached the project for review (via roo backup).

      Here are the steps in the log.roo file:

      // Spring Roo 1.2.0.RELEASE [rev 39eb957] log opened at 2012-01-29 11:21:14
      project --topLevelPackage roo.json.issue --projectName roo-json-issue --java 6
      // Spring Roo 1.2.0.RELEASE [rev 39eb957] log closed at 2012-01-29 11:21:15
      // Spring Roo 1.2.0.RELEASE [rev 39eb957] log opened at 2012-01-29 11:21:18
      jpa setup --database H2_IN_MEMORY --provider HIBERNATE
      entity jpa --class ~.domain.Product
      field string --fieldName productName --column productname --notNull true
      // I manually added the @Id annotation to the productName field in the Product file
      web mvc json setup
      json all
      web mvc json all --package ~.web

        Activity

        Hide
        Alan Stewart added a comment -

        Resolved in Git ID 35aeb6d4578f9136dfb56893b9b7ef98aa8a3bb5. For consistency, the @Id field name will be used in the controller and json methods, rather than the hard-coded "id" as it was.

        Show
        Alan Stewart added a comment - Resolved in Git ID 35aeb6d4578f9136dfb56893b9b7ef98aa8a3bb5. For consistency, the @Id field name will be used in the controller and json methods, rather than the hard-coded "id" as it was.

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Kyung Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: