Announcement Announcement Module
Collapse
No announcement yet.
version property question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:

    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

    Comment


    • #3
      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.

      Comment


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

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment

            Working...
            X