• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
horizontal mapping inheritance fetch trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

horizontal mapping inheritance fetch trouble


  • Subject: horizontal mapping inheritance fetch trouble
  • From: Kieran Kelleher <email@hidden>
  • Date: Thu, 9 Feb 2006 11:39:52 -0500

Is this a bug or am I doing something wrong? .....

I am fetching instances of entity CTProduct qualified as follows:

public NSArray productsWithPendingMessages( EOEditingContext ec ) {
EOQualifier qualifier = new EOKeyValueQualifier( "mediaTemplates.messages.workflowState",
EOQualifier.QualifierOperatorEqual,
CTMessage.WORKFLOW_STATE_READY_TO_BE_SENT );
EOFetchSpecification fs = new EOFetchSpecification( "CTProduct",
qualifier,
null,
true,
false,
null );
NSArray foundProducts = ec.objectsWithFetchSpecification( fs );
if ( log.isDebugEnabled() ) log.debug("foundProducts count = " + foundProducts.count() );
return foundProducts;
}


Relationships
CTProduct <-->> CTMediaTemplate <-->> CTMessage

workflowState is just a text field

CTMessage is an abstract class and subclasses are using horizontal table mapping for inheritance via separate tables. Therefore CTMessage does not have a table in the EOModel definition, so the SQL incorrectly generates a null for the table name. Is it a case of this being too complex for EOF?

Incidentally CTMediaTemplate is also abstract, but I use single table mapping for its subclasses.

The relevant error is:
com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT DISTINCT t0.defaultprice, t0.descriptor, t0.itemid, t0.longdescriptor, t0.oid, t0.oidimage, t0.oidmailingrate, t0.oidoutputmedia, t0.printingcost, t0.recaddtime, t0.recadduser, t0.recmodtime, t0.recmoduser, t0.technotes FROM product t0, null T2, mediatemplate T1 WHERE T2.workflowstate = ? AND T1.oid = T2.oidmediatemplate AND t0.oid = T1.oidproduct" withBindings: 1:"rtbs"(workflowState)>:
Next exception:SQL State:42000 -- error code: 1064 -- msg: Syntax error or access violation message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'null T2, mediatemplate [2006-02-09 11:17:48 EST]


Should I just accept that horizontal inheritance table mapping will kill this kind of a sql generation for a qualifier ...... or just switch to single table mapping which I guess will solve the problem?

_______________________________________________
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


  • Follow-Ups:
    • Re: horizontal mapping inheritance fetch trouble
      • From: Neale Patton <email@hidden>
  • Prev by Date: Re: Newbie Key Value-coding and Subclasses Question
  • Next by Date: Re: horizontal mapping inheritance fetch trouble
  • Previous by thread: Re: Newbie Key Value-coding and Subclasses Question
  • Next by thread: Re: horizontal mapping inheritance fetch trouble
  • Index(es):
    • Date
    • Thread