Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

primative primary key and RI deploytool

 
Van Nguyen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Here is an easy one for you EJB gurus:
what would I put in the "Primary Key Class" text box if my pk is an int?
-thanks,
Van
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<prim-key-class>java.lang.Integer</prim-key-class>
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...just the class, not the xml...
 
Van Nguyen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony,
Thanks for your response. I just found out (EJB book by Monson) that primatives are not allowed as primary keys in EJB. Reason:
- return type of getPrimaryKey (comp interface) returns an Object
- pk type must implement hashcode() and equals()
So I'll have to change my pk from int to Integer.
-thanks,
Van
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic