[ROO-3283] Reverse engineer disable versions and generated identifiers Created: 19/Sep/12  Updated: 27/Dec/13  Resolved: 27/Dec/13

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

Type: Improvement Priority: Major
Reporter: Mario Martínez Sánchez - gvNIX - DISID Assignee: Alan Stewart
Resolution: Complete 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.2.0.4


Attachments: File patch.diff    
Issue Links:
Duplicate
is duplicated by ROO-3281 Reverse engineering a database table ... Resolved

 Description   

Problem: When "database reverse engineer" the application may not work because there are some behaviors we can't control:

  • With all persistence providers, identifier generator fails because sequence not exists in database.
  • A table with a column named "version" is configured as concurrency control property when is not (even not numeric).

Solution: Create "database reverse engineer" command new options to control this behaviors:

  • disableVersionFields (optional, default false): If true, don't add concurrency control feature to version field and generate field as other fields. All entities will have versionField="" attribute in RooJpaActiveRecord annotation.
  • disableGeneratedIdentifiers (optional, default false): If true, don't add generated value feature to identifier field and add field into create view (required and i18n). All entities will have sequenceName="" attribute in RooJpaActiveRecord annotation. This modification allows to disable generated identifiers into direct engineer setting versionField="" attribute in RooJpaActiveRecord annotation too.

I attach a patch with this solution diffs.

This solution has been tested.

See ROO-3281, ROO-3254 and ROO-3255, ROO-2596



 Comments   
Comment by Alan Stewart [ 21/Sep/12 ]

Will be evaulated as an improvement

Comment by Alan Stewart [ 20/Jan/13 ]

Sorry for the delay. Applied the patch with a bit of cleanup. Please test and verify all is working. If any updates required, please do a pull request, rather than a patch from now on.
Thanks

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

Hi Alan.

Tested and it works

Sorry for the delay ...

Regards !

Generated at Wed Dec 11 22:54:10 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.