Vertical inheritance cascade deletes
Vertical inheritance cascade deletes
- Subject: Vertical inheritance cascade deletes
- From: Ken Anderson <email@hidden>
- Date: Fri, 17 Jun 2005 00:23:30 -0400
I have a model that utilizes vertical inheritance (User -> Client)
that is having trouble with cascade deletes. I can't seem to figure
out what kind of structure EOF wants to properly delete related to-
many objects when the relationship is on the parent entity.
By default, the to-many relationship will become a flattened to-many
relationship from the parent entity. With this setup, when you try
and delete an instance of the sub-entity, EOF crashes complaining
about not being able to find a valid qualifier type (really nonsense):
46556 [WorkerThread0] INFO extensions.ERXNSLogLog4jBridge -
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
java.lang.NullPointerException
[2005-06-17 00:20:19 EDT] <WorkerThread0> java.lang.NullPointerException
at com.webobjects.jdbcadaptor.JDBCAdaptor.isValidQualifierType
(JDBCAdaptor.java:659)
at
com.webobjects.eoaccess.EODatabaseContext.isValidQualifierTypeForAttribu
te(EODatabaseContext.java:5175)
at
com.webobjects.eoaccess.EODatabaseContext.lockingNonQualifiableAttribute
s(EODatabaseContext.java:5189)
at
com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForData
baseOperationAttributes(EODatabaseContext.java:5439)
at
com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForData
baseOperation(EODatabaseContext.java:5549)
at com.webobjects.eoaccess.EODatabaseContext.performChanges
(EODatabaseContext.java:6366)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo
ntext(EOObjectStoreCoordinator.java:415)
at com.webobjects.eocontrol.EOEditingContext.saveChanges
(EOEditingContext.java:3187)
I figured I'd try changing the flattened to-many relationships to
just be copies of the parent's to-many relationship (similar to a
single-table inheritance setup). When I do that, I get a different
crash:
41989 [WorkerThread0] INFO extensions.ERXNSLogLog4jBridge -
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
java.lang.NullPointerException
[2005-06-17 00:11:12 EDT] <WorkerThread0> java.lang.NullPointerException
at com.webobjects.eoaccess.EOSQLExpression._flattenRelPathEntity
(EOSQLExpression.java:302)
at
com.webobjects.eoaccess.EOSQLExpression._aliasForRelationshipPath
(EOSQLExpression.java:325)
at
com.webobjects.eoaccess.EOSQLExpression._aliasForRelatedAttributeRelatio
nshipPath(EOSQLExpression.java:259)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForAttributePath
(EOSQLExpression.java:2135)
at
com.webobjects.eoaccess._EOExpressionArray.valueForSQLExpression
(_EOExpressionArray.java:177)
at com.webobjects.eoaccess.EOSQLExpression.sqlStringForAttribute
(EOSQLExpression.java:2060)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForAttributePath
(EOSQLExpression.java:2133)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForAttributeNamed
(EOSQLExpression.java:1935)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier
(EOSQLExpression.java:1693)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$_KeyValueQualifierSupport.sqlStringForSQLExpression
(EOQualifierSQLGeneration.java:441)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers
(EOSQLExpression.java:1562)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(
EOSQLExpression.java:1597)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$_AndQualifierSupport.sqlStringForSQLExpression
(EOQualifierSQLGeneration.java:512)
Yes, of course I could do this work myself and ignore EOF's features,
but if it can work, I'd like it to work right. If anyone has any
ideas on how to set this up properly, I'd love to hear about it!
Thanks!
Ken
_______________________________________________
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