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

PrimaryKey class must have no argument constructor? why?

 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PrimaryKey class must have no argument constructor? why?
 
Robin Zhang
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know primary key must has default constructor in CMP, I do not know if it is the same in BMP.
[ April 12, 2002: Message edited by: Robin Zhang ]
 
Alex Pisarev
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Win Yu:
PrimaryKey class must have no argument constructor? why?

What kind of constuctor do you think will be suitable for Primary Key class from the logical point of view???
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p. 188 EJB's 2nd Ed. by Monson-Haefel O'Reilly & Assoc.
The no-augrument constructor is required for CMP. When a new bean is created, the container automatically instantiates the primary key using the Class.newInstance() method, and populates it from the class's container managed fields. A no aurgument constructor must exist in order for that to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic