cross-model relationships problem
cross-model relationships problem
- Subject: cross-model relationships problem
- From: Lachlan Deck <email@hidden>
- Date: Mon, 19 Nov 2007 18:00:45 +1100
I've got a many-to-many join like so (flattened):
EntityA(ModelA)<<--JoinAB(ModelA)-->>EntityB(ModelB)
However, I'm getting an sql exception being thrown when it's
attempting to insert the join record. It seems to be ignoring the
fact that the tables are in a different database, and is attempting
to find EntityA in ModelB's datastore!
Should this be working? Is the flattening the problem when crossing
models? Any other ideas on how to get this working?
Thanks.
with regards,
--
Lachlan Deck
com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression
failed: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression:
"SELECT t0.created, etc... t0.id, t0.modified, ... FROM EntityB t0,
EntityA T2, JoinAB T1 WHERE T2.id = ? AND T1.entityAId = T2.id AND
t0.id = T1.entityBId" withBindings: 1:5537(id)>:
Next exception:SQL State:42S02 -- error code: 1146 -- msg: Table
'db_B.EntityA' doesn't exist
at
com.webobjects.jdbcadaptor.JDBCContext._jdbcErrorWithChannel
(JDBCContext.java:138)
at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression
(JDBCChannel.java:310)
at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression
(JDBCChannel.java:261)
at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes
(JDBCChannel.java:185)
at
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationE
ditingContext(EODatabaseChannel.java:878)
at
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecific
ation(EODatabaseChannel.java:215)
at
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecification
EditingContext(EODatabaseContext.java:3205)
at
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(
EODatabaseContext.java:3346)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecif
ication(EOObjectStoreCoordinator.java:539)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(
EOEditingContext.java:4114)
at er.extensions.ERXEC.objectsWithFetchSpecification
(ERXEC.java:1068)
at
com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID
(EODatabaseContext.java:4260)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlobal
ID(EOObjectStoreCoordinator.java:682)
at
com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID
(EOEditingContext.java:3965)
at er.extensions.ERXEC.objectsForSourceGlobalID(ERXEC.java:
1029)
at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault
(EODatabaseContext.java:4427)
at
com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitialization
OfObject(EOAccessArrayFaultHandler.java:70)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead
(_EOCheapCopyMutableArray.java:38)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.count
(_EOCheapCopyMutableArray.java:92)
at
com.webobjects.eocontrol.EOClassDescription.propagateDeleteForObject
(EOClassDescription.java:511)
at
com.webobjects.eocontrol.EOCustomObject.propagateDeleteWithEditingContex
t(EOCustomObject.java:688)
at
com.webobjects.eocontrol.EOEditingContext.propagateDeletesUsingTable
(EOEditingContext.java:2231)
at
com.webobjects.eocontrol.EOEditingContext._processDeletedObjects
(EOEditingContext.java:2193)
at
com.webobjects.eocontrol.EOEditingContext._processRecentChanges
(EOEditingContext.java:1744)
at
com.webobjects.eocontrol.EOEditingContext.processRecentChanges
(EOEditingContext.java:1951)
at er.extensions.ERXEC.processRecentChanges(ERXEC.java:616)
at er.extensions.ERXEnterpriseObject
$Observer.editingContextWillSaveChanges(ERXEnterpriseObject.java:41)
at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.webobjects.foundation.NSSelector._safeInvokeMethod
(NSSelector.java:120)
at com.webobjects.foundation.NSNotificationCenter
$_Entry.invokeMethod(NSNotificationCenter.java:601)
at
com.webobjects.foundation.NSNotificationCenter.postNotification
(NSNotificationCenter.java:545)
at
com.webobjects.foundation.NSNotificationCenter.postNotification
(NSNotificationCenter.java:559)
at er.extensions.ERXEC.saveChanges(ERXEC.java:861)
<...>
_______________________________________________
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