Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to remove the "version" property in JPA persistence? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to remove the "version" property in JPA persistence?

    Is it possible to remove the "version" property in Roo-managed JPA persistence?

    Note: Someone else already asked this on StackOverflow and got no correct answer yet.

  • #2
    Originally posted by dserodio View Post
    Is it possible to remove the "version" property in Roo-managed JPA persistence?
    In web layer (jspx) you can set value "none" to version property for avoid use it.
    In entity layer (java) i think you can push in this property, remove the @Version annotation and put the @Transient one.

    Regards !

    Comment


    • #3
      Thanks for the response; I guess I'll have to "push in" both the _Jpa_Entity.aj and the _Jpa_ActiveRecord.aj then since both are generated from the same @RooJpaActiveRecord annotation and ActiveRecord depends on Entity.

      Roo is turning out to be much less flexible then I had expected...

      Comment


      • #4
        I simply add

        @Version
        @Transient
        private Integer version;

        to the java class

        Comment


        • #5
          Another solution is to set the version attribute with no value:

          @RooJpaActiveRecord(versionField="", ...)

          I think this is the better solution ...
          Last edited by mmartinez; Aug 30th, 2012, 12:44 PM.

          Comment

          Working...
          X