Announcement Announcement Module
No announcement yet.
Please add ‚versionColumn’ to RooEntity. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please add ‚versionColumn’ to RooEntity.


    We have a legacy database schema where all version columns have a name with an underscore. I know there are a couple of workarounds for that but it would be nice if one could declare a ‚versionColumn’ when creating an entitiy with roo.

    Thanks in advance.

  • #2
    Hi David,

    There are a number of options you can look at. First, in case you are using Hibernate as ORM you should take a look at the improved naming strategy they are offering. I believe that should help you.

    Second, you could create a abstract superclass for all fields which are shared by your entities. Then use the @Column annotation to adjust the field name mappings in only one place. The same applies to fields in your normal entities though.

    I am not sure we would offer this level of customization in Roo itself as it is a rather uncommon requirement (falls into the 20 percentile) and it is not Roo's intention to expose or wrap all JPA customization options via the shell or Roo annotations. Again, specifying the mappings the @Column annotation will solve your problem.