Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-11975

JPA Tooling - Adding JPA Annotations to a POJO - Allow users to choose the field to be marked as PK

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.2.x
    • None
    • hibernate

      Hi,

      I am using JBDS 5.0 Beta 3. I created a POJO with follwoing attributes :

      String username;
      String password
      String loginCount;

      Then I invoked conetxt menu option "Generate Hibernate/JPA annotations", it generates only @Entity annotation. Obviously there is no way for the wizard to find out which attribute should act as PK. However if I include a string "id" anywhere in "username" e.g idusername, usernameid, useridname, it assumes it to be the PK and generates @Id and @GeneratedValue annotation. I wonder if this is by design? I think a better approach would be to let the user choose on the wizard, which field he wants to mark as PK.

            kaers@redhat.com Koen Aers
            rhn-services-vkansal Vimal Kansal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: