I'm sure it's not a new, empty instance of the rsComponent..
#1) the rsComponents() relationship is not maditory in the EOModel, and it is to-many from RoutingStep (RoutingStep<-->>rsComponent).
#2) I have logging (thanks to EOGenerator) on all my setters, and it shows what the previous value was and what the new value is. It is taking an object with values, and nullifying them.
Here's an example from the Run Log. See comments within:
Here it sets the routingStep relationship properly (see bottom of email for the setRoutingStepRelationship() code).
2007-04-11 07:45:27,282 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutingStepRelationship - updating routingStep from {values = {routingStepSequence = 4; instructions = "Fast Blend Oats 10-15-SECONDS"; workCenter = "<com.bestmaid.bakeryManagement.routing.WorkCenter 283922 _EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing = "<com.bestmaid.bakeryManagement.routing.BillOfMaterial 50262b _EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>"; billOfMaterialComponents = ("<com.bestmaid.bakeryManagement.routing.BillOfMaterialComponent 583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long)8495]>"); routingStepName = "Fast Blend Oats"; toolConfigurations = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 587427 (<EOAccessArrayFaultHandler toolConfigurations _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7164]>)>"; }; this = "<com.bestmaid.bakeryManagement.routing.RoutingStep 8475ef _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7164]>"; } to {values = {routingStepSequence = 5; instructions = "Test"; workCenter = "<com.bestmaid.bakeryManagement.routing.WorkCenter 283922 _EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing = "<com.bestmaid.bakeryManagement.routing.BillOfMaterial 50262b _EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>"; billOfMaterialComponents = (); routingStepName = "Test"; toolConfigurations = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 31eb31 (<EOAccessArrayFaultHandler toolConfigurations _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>)>"; }; this = "<com.bestmaid.bakeryManagement.routing.RoutingStep a614a4 _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; }
Immediately followed by other misc updates:
2007-04-11 07:45:27,287 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setLineNumber - updating lineNumber from 17 to 17
2007-04-11 07:45:27,354 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setScrapPercent - updating scrapPercent from 0.000000 to 0.0000
Here it begins setting all attributes of the same rsComponent (aka BillOfMaterialComponent) to null! you can see by the time stamp that it is doing it immediately after the proper update. Also, I can tell by the attributes (part.partDescription, etc) that it is, in fact, the rsComponent that I requested be updated that is now being nullified.
2007-04-11 07:45:27,356 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutingStepRelationship - updating routingStep from {values = {routingStepSequence = 5; instructions = "Test"; workCenter = "<com.bestmaid.bakeryManagement.routing.WorkCenter 283922 _EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing = "<com.bestmaid.bakeryManagement.routing.BillOfMaterial 50262b _EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>"; billOfMaterialComponents = ("<com.bestmaid.bakeryManagement.routing.BillOfMaterialComponent 583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long)8495]>"); routingStepName = "Test"; toolConfigurations = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 31eb31 (<EOAccessArrayFaultHandler toolConfigurations _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>)>"; }; this = "<com.bestmaid.bakeryManagement.routing.RoutingStep a614a4 _EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; } to null
[2007-04-11 07:45:27 COT] <WorkerThread2> Validation failed on an object [null] with keypath = aRequestedBillOfMaterialBillOfMaterialComponent.lineNumber and exception: The lineNumber property of BillOfMaterialComponent is not allowed to be null.
2007-04-11 07:45:27,371 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setPartRelationship - updating part from {values = {rawType = "<com.bestmaid.bakeryManagement.part.RawType 54f497 (com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID[RawType (java.lang.Long)7])>"; unitOfMeasure = "<com.bestmaid.bakeryManagement.utility.UnitOfMeasure fed367 _EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>"; lotCodes = "<com.webobjects.eocontrol._EOCheapCopyMutableArray b2b9ec (<EOAccessArrayFaultHandler lotCodes _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; componentOfBillsOfMaterial = "<com.webobjects.eocontrol._EOCheapCopyMutableArray c04c06 (<EOAccessArrayFaultHandler componentOfBillsOfMaterial _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; statementBlocks = "<com.webobjects.eocontrol._EOCheapCopyMutableArray f4c346 (<EOAccessArrayFaultHandler statementBlocks _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; partDescription = "Oats, Quick , Oats, Quick"; nutritionBlocks = "<com.webobjects.eocontrol._EOCheapCopyMutableArray cc6cb4 (<EOAccessArrayFaultHandler nutritionBlocks _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; partNumber = "02070000000041"; partType = "<com.bestmaid.bakeryManagement.part.PartType 860b1d (com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID[PartType (java.lang.Long)2])>"; partName = "Oats, Quick "; workCentersUsedIn = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 43d287 (<EOAccessArrayFaultHandler workCentersUsedIn _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; }; this = "<com.bestmaid.bakeryManagement.part.Raw c6948c _EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>"; } to null
[2007-04-11 07:45:27 COT] <WorkerThread2> Validation failed on an object [null] with keypath = aRequestedBillOfMaterialBillOfMaterialComponent.scrapFixed and exception: The scrapFixed property of BillOfMaterialComponent is not allowed to be null.
2007-04-11 07:45:27,404 DEBUG com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setUnitOfMeasureRelationship - updating unitOfMeasure from {values = {uomAbbreviation = "lb"; uomNamePlural = "Pounds"; uomAbbreviationPlural = "lbs"; baseUnitOfMeasureConversions = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 4f5403 (<EOAccessArrayFaultHandler baseUnitOfMeasureConversions _EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>)>"; convertedUnitOfMeasureConversions = "<com.webobjects.eocontrol._EOCheapCopyMutableArray fb541d (<EOAccessArrayFaultHandler convertedUnitOfMeasureConversions _EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>)>"; unitOfMeasureType = "<com.bestmaid.bakeryManagement.utility.UnitiOfMeasureType 1b7e37 (com.webobjects.eoacc[2007-04-11 07:45:27 COT] <WorkerThread2> Validation failed on an object [null] with keypath = aRequestedBillOfMaterialBillOfMaterialComponent.partQuantity and exception: The partQuantity property of BillOfMaterialComponent is not allowed to be null.
ess.EOAccessFaultHandler _EOIntegralKeyGlobalID[UnitOfMeasureType (java.lang.Long)1])>"; uomName = "Pound"; }; this = "<com.bestmaid.bakeryManagement.utility.UnitOfMeasure fed367 _EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>"; } to null
[2007-04-11 07:45:27 COT] <WorkerThread2> Validation failed on an object [null] with keypath = aRequestedBillOfMaterialBillOfMaterialComponent.scrapPercent and exception: The scrapPercent property of BillOfMaterialComponent is not allowed to be null.
Here is the code for all my routingStep related getters and setters on the rsComponent class:
public com.bestmaid.bakeryManagement.routing.RoutingStep routingStep() {
return (com.bestmaid.bakeryManagement.routing.RoutingStep)storedValueForKey("routingStep");
}
public com.bestmaid.bakeryManagement.routing.RoutingStep routingStepRelationship() {
return routingStep();
}
public void setRoutingStepRelationship(com.bestmaid.bakeryManagement.routing.RoutingStep aValue) {
if( log.isDebugEnabled() ) log.debug( "updating routingStep from "+routingStep()+" to "+aValue );
if( aValue == null ) {
com.bestmaid.bakeryManagement.routing.RoutingStep object = routingStep();
if( object != null )
removeObjectFromBothSidesOfRelationshipWithKey( object, "routingStep" );
} else
addObjectToBothSidesOfRelationshipWithKey( aValue, "routingStep" );
}