[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
Environment:

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


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

 Description   

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)


 Comments   
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 Wed Dec 11 09:47:00 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.