Announcement Announcement Module
No announcement yet.
Persistence schema generation request Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Persistence schema generation request

    I would like to see roo take the information in the JSR-303 annotations such as

    @Size(min = 1, max = 40)
    private String conferenceName;

    and then find a way to generate the appropriate field attributes in the target database ala JPA.

    I'm not sure this can be done without somehow emulating the JPA @NotNull, @Column and other annotations. Until then, you get a false sense that the schema is being generated appropriately, but setting @Size(...) does not do anything to the length of the JPA field (it will be 255 by default on mysql with hibernate for example), @NotNull doesn't manipulate the schema null option, etc...

    I know I mentioned this early on but more as someone who has used the JPA annotations and that led to discussion around the JSR-303 annotations being the ones roo will use.

    Should I create this as an improvement JIRA task or is it on an internal roadmap? I only ask because I'm giving a demo to a user group, and was curious what the position is on the roo team on integration with JPA for attribute management on forward schema generation (I'm sure that question will come up)


  • #2
    Hi Ken,

    Yes please open a Jira ticket for this.I#ll look into it. As far as I can see we can only honor the JSR 303 @NotNull and @Size(max=30) though. Both would translate into a JPA @Column(nullable=false, length=30).

    Anything else I am missing?