Patches item #644394, was opened at 2002-11-26 17:04 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376687&aid=644394&group_id=22866
Category: JBossCMP Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Scott Walters (scottw512) Assigned to: Nobody/Anonymous (nobody) Summary: support for cmr+cmp not null fields Initial Comment: This patch addresses issues with fields that exist as both CMP fields and as part of a CMR field, particularly when the field is not null. There are two different issues addressed by these changes. First, there are duplicate column names in the insert and create table sql commands that jboss generates. Second, jboss attempts to insert NULL values for these fields, even when they are part of the primary key. The first issue is dealt with by building a list of unique fields to use for the create table and insert statements. This list of fields contains all the CMP fields followed by the CMR fields that are not in the CMP field list. The second issue is taken care of by the insertion of code to populate the bean instance values for the duplicated CMR fields before the sql insert parameters are bound. This way, when the parameter binding code executes, the correct values are pulled from the bean instance as if they had been set in ejbCreate. This is accomplished by invoking the "get" method on the local interface argument passed into ejbCreate. The way it works is by querying the duplicated CMR field's related field and extracting it's field name and it's local interface name. Then, the arguments to ejbCreate are inspected for a matching local interface name and a matching get method for the field name. When it finds a match, the get method is invoked and the return value is assigned to the bean instance. For this change to work properly, the local interfaces for the related fields of the duplicated CMR fields must be passed in as arguments to ejbCreate. Also, since the get method is invoked and the bean instance value is set after the ejbCreate call, any code in ejbCreate that sets the field's bean instance value will be overridden. This is the sequence of events. 1) ejbCreate is called normally and returns. 2) the patch code is called to populate duplicated CMR field instance values 3) the primary key is extracted from the bean and stored in the container context 4) the sql insert statement is prepared and executed. 5) ejbPostCreate is called. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376687&aid=644394&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
