Results 1 to 6 of 6

Thread: version property question

  1. #1
    Join Date
    Oct 2005
    Location
    Mobile, AL
    Posts
    345

    Default version property question

    I am looking into incorporating ROO into a exising DB schema and I don't current have version columns in my tables. Is the version property a required property when creating entities from ROO?

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    Hi Marty,

    The version column is not mandatory in your data model, however we recommend it since it enables JPA-managed optimistic locking features. In Roo managed applications you can switch it off by just passing an empty String type for the versionField parameter of the RooEntity annotation:

    Code:
    @RooEntity(versionField="")
    Note, if you want to create scaffolding for any entities which don't have a version field, there is a recent bug fix (http://jira.springframework.org/browse/ROO-388) in the current Roo trunk which requires you to use a Roo build from trunk until Roo RC4 is released.

    -Stefan

  3. #3
    Join Date
    Oct 2005
    Location
    Mobile, AL
    Posts
    345

    Default Quick Question

    Stefan,

    This works if I manually set this in the RooEntity annotation of the identifier. Can you set the versionField to empty strings from the Entity addon? I tried --versionField "" but it still created the standard version property in the aspect file.

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    There is no --versionField argument on the "entity" command. You'll need to edit the .java file which has the @RooEntity in it by hand. That should sort out your problem.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    Apr 2007
    Location
    Oslo, Norway
    Posts
    9

    Default Reproducible scaffolding bug in Release 1.0.0

    This seems to have reoccurred in Roo Release 1.0.0

    When setting

    Code:
    @RooEntity(versionField="")
    on a class

    I still get a NullPointerException from the JSP document helper.

    Removing the versionField="" causes everything to work again, but will throw an error about missing versionField since the tables I'm working with do not contain the version column.

    According to JIRA this was resolved in RC4.

    Should I reopen the JIRA, alternatively create a new ticket?
    Best regards
    Christopher Kolstad

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Please feel free to post a Jira bug report at https://jira.springsource.org/browse/ROO. We'll take a look and fix it ASAP.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •