Announcement Announcement Module
No announcement yet.
version property question Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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:

    Note, if you want to create scaffolding for any entities which don't have a version field, there is a recent bug fix ( in the current Roo trunk which requires you to use a Roo build from trunk until Roo RC4 is released.



    • #3
      Quick Question


      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
        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.


        • #5
          Reproducible scaffolding bug in Release 1.0.0

          This seems to have reoccurred in Roo Release 1.0.0

          When setting

          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
            Please feel free to post a Jira bug report at We'll take a look and fix it ASAP.