-
1. Re: CMP Bean ignores the default values
lepekhine Jan 30, 2002 8:50 AM (in response to thomas_x)The main idea of CMP beans is to make them separate from the database. You can deploy CMP EJB on any J2EE server backed with any database. So CMP bean can't be "for the following table". CMP bean don't know anything about the table and don't have to know. Rather "the table is for CMP bean". There is no magic. Of course each bean may corresponds to the table row but in unidirectional way.
The important consequence from it is that you can add additional constraints on the database level in addition to buisiness logic in EJB. For example you may guarantee the referential integriry between tables wich corresponds to the independent J2EE components. -
2. Re: CMP Bean ignores the default values
dsundstrom Jan 30, 2002 4:04 PM (in response to thomas_x)This is in the EJB spec. All fields are initialized to java defaults on create. If you want defaults, you will have to set them in the ejbCreate method. You could code your system to lookup the defaults in the env context of your bean and then assign them in ejbCreate, but you will have to code it.