[
https://issues.jboss.org/browse/JBIDE-11975?page=com.atlassian.jira.plugi...
]
Max Rydahl Andersen commented on JBIDE-11975:
---------------------------------------------
yes, the initial intent was that the ui shuold be as simple as possible to avoid
complexity.
Thus we look for id properties and if you don't set one we don't add one and you
will get an error by the validator that you can easily fix and then run the generation
again.
That said, I agree for missing @Id it makes sense asking or at least pointing out @Id
needs to be added.
Putting on 3.4.x though since its a bigger change/fix.
JPA Tooling - Adding JPA Annotations to a POJO - Allow users to
choose the field to be marked as PK
---------------------------------------------------------------------------------------------------
Key: JBIDE-11975
URL:
https://issues.jboss.org/browse/JBIDE-11975
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: hibernate
Reporter: Vimal Kansal
Fix For: 3.4.x
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira