[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

Ubuntu 12.04, JDK 1.6.0_33, Maven 3.0.4, Oracle

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


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

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.

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 Sun Jul 12 08:08:11 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.