In O"Reilly book Entreprise JavaBeans(pg 158) he states that.. "The no-argument constructor is required for container managed persistence". Shouldn't it also be required for BMP?
Certifications: <br />scp2, scea, scwcd, WL7.0, CISSP, XML
posted 15 years ago
Hello Andy, In CMP the primary-key is instanciated by the container, that is why it needs a no-argument constructor. (the container will do the job to find a correct unique id for this PK). While in BMP the primary key is instantiated by you, then it is not required to be a no-argument constructor. It is your job to be sure that you got a unique id for this PK, (usually via a idProvider that pooled numbers of unique id). Therefore a BMP primary key usually take an int or a long as contructor argument. Hope this is clear !