[ROO-3281] Reverse engineering a database table with version column name when is not a @Version Created: 18/Sep/12  Updated: 21/Sep/12  Resolved: 21/Sep/12

Status: Resolved
Project: Spring Roo
Component/s: @ CORE, PERSISTENCE
Affects Version/s: 1.2.2.RELEASE
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Mario Martínez Sánchez - gvNIX - DISID Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: error-reporting, jpa, roo, waiting-for-triage
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Ubuntu 12.04, JDK 1.6.0_33, Maven 3.0.4, Oracle 10

Attachments: File patch.diff    
Issue Links:
duplicates ROO-3283 Reverse engineer disable versions and... Resolved


Execute a reverse engineering in a database table with a column named "version".
Generated property is annotated with @Version, when this column there is not a concurrency control column.

Entity update will modify automatically this value when could store important info.
Also application can crash if version column has no numeric type (varchar in example).

Related task ROO-3254 closed before solution patch created.

I attach a diff patch with a solution:

  • Create new command option "disableVersionFields"
  • By default work as before (false by default)
  • If true, don't generate a "@Version" property (in Entity.aj) when "version" column name found
  • Generate "version" property as any other field (in DbManaged.aj and entity *.jspx)

Comment by Mario Martínez Sánchez - gvNIX - DISID [ 18/Sep/12 ]

I attach new diff with only this task modifications, last patch has other modifications.

Comment by Mario Martínez Sánchez - gvNIX - DISID [ 19/Sep/12 ]

Please, close this task as duplicated by ROO-3283.

Generated at Thu Jul 09 18:43:52 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.