Is it possible (and recommended) to use stored procedures with the J2EE architecture? We would be interested in creating objects directly into the database, bypassing the create method of the enterprise bean. Is this possible when using CMP (Container Managed Persistence)? If not, in your opinion, which is best: using BMP and stored procedures or using CMP?

 

Example: We have an Oracle DB that uses packages associated to the business objects of the system. These packages contain the PL/SQL methods of the corresponding business objects.  Additionally every business object’s fields are stored as columns of a specific table. The constructor of a business object is also a method in the associated package. The inheritance relation between two objects is modeled by making the primary key of the child object’s table reference the primary key field of the parent object’s table. This reference means that the child inherits the fields of the parent. Thus, the constructor of a child object, which is passed all the parameters required for itself and its parent’s initialization, will call the constructor of its parent passing the appropriate parameters. The question is:

 

How could such constructors be used without conflicting with the create methods of the CMP entity beans?


Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to