Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: DB2 database support in Roo

  1. #21

    Default how to declare a field as primary key

    how to declare the field as primary key....using roo.....
    when creating a field using roo ...then how can i declare it as primary key...

  2. #22
    Join Date
    May 2006
    Location
    Madrid
    Posts
    383

    Default

    Quote Originally Posted by dineshkumar.n View Post
    how to declare the field as primary key....using roo.....
    when creating a field using roo ...then how can i declare it as primary key...
    You can define the identifier field when declaring the entity:

    entity --class ~.domain.MyClass --table MY_TABLE --identiferField code --identiferColumn CODE

    By default, Roo declares a Long "id" attribute.

    If the Roo commnad doesn't work, you can edit your java class adding the @Id anottation, creating get and set for the attirbute and letting Roo to do its job recreating the .aj files.

    There are several POSTs and some JIRA tickets regarding this issue.

Posting Permissions

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