Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Complete
-
1.2.0.RELEASE
-
Mac OSX, STS 2.8.1 (release)
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