Re: Problem with deleting a related object (to-many relationship)
Re: Problem with deleting a related object (to-many relationship)
- Subject: Re: Problem with deleting a related object (to-many relationship)
- From: "Daniele Corti" <email@hidden>
- Date: Mon, 11 Jun 2007 09:17:44 +0200
2007/6/8, David Avendasora <email@hidden>:
Hi all,
I have the following relationship: Tool <-->> ToolConfiguration.
- Optionality for the "tool" relationship in ToolConfiguration is
"Mandatory"
- Optionality for the "toolConfigurations" relationship of Tool is
"Optional"
- "Owns Destination" is checked for the "toolConfigurations"
relationship of Tool
When I remove a toolConfiguration from the toMany relationship and
save, I get an error stating "Save Failed: Relationship tool must
have a Tool!"
By having the "Owns Destination" checked on the "toolConfigurations"
relationship, shouldn't removing a toolConfiguration from the
relationship automatically Delete the ToolConfiguration object? Am I
missing something fundamental?
Thanks,
Dave
P.S. Here's the .plist files for each entity:
{
attributes = (
{columnName = "Is_Active"; name = isActive; prototypeName =
boolean; },
{columnName = "Tool_ID"; name = toolId; prototypeName =
keyId; },
{columnName = "Tool_Name"; name = toolName; prototypeName =
entityName; },
{columnName = "Tool_Type_ID"; name = toolTypeId;
prototypeName = keyId; }
);
attributesUsedForLocking = (isActive, toolTypeId, toolId,
toolName);
className = "com.bestmaid.bakeryManagement.routing.Tool";
classProperties = (
toolConfigurations,
primaryTools,
toolType,
isActive,
secondaryTools,
usedInToolConfigurations,
toolName
);
externalName = "dbo.Tool";
fetchSpecificationDictionary = {};
internalInfo = {
"_clientClassPropertyNames" = (
toolConfigurations,
primaryTools,
toolType,
isActive,
secondaryTools,
usedInToolConfigurations,
toolName
);
"_javaClientClassName" = EOGenericRecord;
"_nameInObjectStore" = "dbo.Work_Center";
uniqueID = 198115770;
};
name = Tool;
primaryKeyAttributes = (toolId);
relationships = (
{
deleteRule = EODeleteRuleDeny;
destination = ToolRelationship;
internalInfo = {"_nameInObjectStore" = primaryTools;
uniqueID = 186092893; };
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = secondaryToolId;
sourceAttribute = toolId; });
name = primaryTools;
ownsDestination = Y;
},
{
deleteRule = EODeleteRuleCascade;
destination = ToolRelationship;
internalInfo = {"_nameInObjectStore" = secondaryTools;
uniqueID = 186092845; };
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = primaryToolId;
sourceAttribute = toolId; });
name = secondaryTools;
ownsDestination = Y;
},
{
deleteRule = EODeleteRuleCascade;
destination = ToolConfiguration;
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = toolId; sourceAttribute
= toolId; });
name = toolConfigurations;
ownsDestination = Y;
},
{
destination = ToolType;
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = toolTypeId;
sourceAttribute = toolTypeId; });
name = toolType;
},
{
deleteRule = EODeleteRuleCascade;
destination = ToolConfigurationTool;
internalInfo = {"_nameInObjectStore" =
toolConfigurations; };
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = toolId; sourceAttribute
= toolId; });
name = usedInToolConfigurations;
ownsDestination = Y;
}
);
restrictingQualifier = "(toolTypeId = 2)";
userInfo = {fetchSpecificationDictionary = {}; };
}
{
attributes = (
{
columnName = "Breakdown_Time";
name = breakdownTime;
prototypeName = quantity;
},
{
columnName = "Concurrency_Factor";
name = concurrencyFactor;
prototypeName = quantity;
},
{
columnName = "Configuration_Description";
name = configurationDescription;
prototypeName = entityDescription;
},
{
columnName = "Configuration_Instructions";
name = configurationInstructions;
prototypeName = longText;
},
{columnName = "Interval_Time"; name = intervalTime;
prototypeName = quantity; },
{columnName = "Process_Time"; name = processTime;
prototypeName = quantity; },
{
columnName = "Production_Sequence";
name = productionSequence;
prototypeName = quantity;
},
{columnName = "Setup_Time"; name = setupTime; prototypeName
= quantity; },
{
columnName = "Tool_Configuration_ID";
name = toolConfigurationId;
prototypeName = keyId;
},
{columnName = "Tool_ID"; name = toolId; prototypeName =
keyId; }
);
attributesUsedForLocking = (
productionSequence,
toolConfigurationId,
toolId,
configurationDescription,
breakdownTime,
concurrencyFactor,
intervalTime,
processTime,
setupTime
);
className =
"com.bestmaid.bakeryManagement.routing.ToolConfiguration";
classProperties = (
configurationInstructions,
routingSteps,
tool,
routings,
productionSequence,
configurationDescription,
toolsUsed,
breakdownTime,
concurrencyFactor,
intervalTime,
processTime,
setupTime
);
externalName = "dbo.Tool_Configuration";
fetchSpecificationDictionary = {};
internalInfo = {
"_clientClassPropertyNames" = (
configurationInstructions,
routingSteps,
tool,
routings,
productionSequence,
configurationDescription,
tools,
setupTime,
processTime,
intervalTime,
concurrencyFactor,
breakdownTime,
usesTools,
toolsUsed
);
"_javaClientClassName" = EOGenericRecord;
"_nameInObjectStore" = "Tool_Configuration";
uniqueID = 198115577;
};
name = ToolConfiguration;
primaryKeyAttributes = (toolConfigurationId);
relationships = (
{
deleteRule = EODeleteRuleDeny;
destination = RoutingStepToolConfiguration;
internalInfo = {"_nameInObjectStore" = routingSteps;
uniqueID = 198114823; };
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = (
{
destinationAttribute = toolConfigurationId;
sourceAttribute = toolConfigurationId;
}
);
name = routingSteps;
ownsDestination = Y;
},
{
deleteRule = EODeleteRuleDeny;
destination = RoutingToolConfiguration;
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = (
{
destinationAttribute = toolConfigurationId;
sourceAttribute = toolConfigurationId;
}
);
name = routings;
ownsDestination = Y;
},
{
destination = Tool;
internalInfo = {uniqueID = 198114814; };
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = toolId; sourceAttribute
= toolId; });
name = tool;
},
{
deleteRule = EODeleteRuleCascade;
destination = ToolConfigurationTool;
internalInfo = {"_nameInObjectStore" = tools; };
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = (
{
destinationAttribute = toolConfigurationId;
sourceAttribute = toolConfigurationId;
}
);
name = toolsUsed;
ownsDestination = Y;
}
);
userInfo = {fetchSpecificationDictionary = {}; };
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden