Results 1 to 5 of 5

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

  1. #1
    Join Date
    Jun 2005
    Location
    São Paulo, Brasil
    Posts
    86

    Question 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.
    Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

  2. #2
    Join Date
    Jan 2010
    Location
    Mislata - Valencia - Spain
    Posts
    162

    Default

    Quote 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 !
    Mario Martínez Sánchez
    Project Manager & Software Architect
    --------------------------
    Disid Technologies S.L.
    http://www.disid.com
    --------------------------
    gvNIX
    http://gvnix.googlecode.com
    http://www.gvnix.org

  3. #3
    Join Date
    Jun 2005
    Location
    São Paulo, Brasil
    Posts
    86

    Unhappy

    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...
    Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

  4. #4
    Join Date
    Dec 2010
    Posts
    29

    Default

    I simply add

    @Version
    @Transient
    private Integer version;

    to the java class

  5. #5
    Join Date
    Jan 2010
    Location
    Mislata - Valencia - Spain
    Posts
    162

    Default

    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 at 11:44 AM.
    Mario Martínez Sánchez
    Project Manager & Software Architect
    --------------------------
    Disid Technologies S.L.
    http://www.disid.com
    --------------------------
    gvNIX
    http://gvnix.googlecode.com
    http://www.gvnix.org

Posting Permissions

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