Announcement Announcement Module
Collapse
No announcement yet.
UUID as Primary Key Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UUID as Primary Key

    Is is possible to have Roo generate a String field which is filled with an UUID as PK instead of the auto-incremented Integers?

  • #2
    Hi,

    We have done this in our project. We are using Roo, with Hibernate as the persistence provider, and implemented the UUIDs by pushing in the id into our Entity classes, and annotating like this:

    Code:
        @Id
        @GenericGenerator(name = "HibernateUuidGenerator", strategy = "uuid2")
        @GeneratedValue(generator = "HibernateUuidGenerator")
        private String id;
    Andy

    Comment


    • #3
      Thanks for that piece of information!

      I wonder if it's possible to specify the generator in the roo script? I did not see any option for that. Maybe I should raise a JIRA-Ticket.

      I am about to set up a project with many tables and would prefer to have the right config from start

      Comment


      • #4
        @yglodt
        I think a JIRA ticket has been raised and declined.
        Just as an FYI.

        Comment

        Working...
        X