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...
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.