On 2013-01-26, at 5:12 PM, James Cicenia wrote: > Hmmm, > > Why would I want it abstract?
Is it a real EO? Are there ever instances of that EO? If not, abstract. If so, need a qualifier. > > Anyway, I put a qualifier in the root entity osType = 'All' > > then the sql that was generated was: > > DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: > <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT > RTRIM(t0.alertString), t0.appConfigAndroidID, t0.appConfigBBID, > t0.appConfigIOSID, t0.appConfigWinID, t0.appConfigWinPhoneID, t0.appID, > t0.badge, RTRIM(t0.cronExpression), t0.dateCompleted, t0.dateCreated, > t0.dateToPush, t0.id, RTRIM(t0.message), t0.notificationAlertAppleID, > RTRIM(t0.osType), RTRIM(t0.sound), t0.status, RTRIM(t0.title) FROM > Notification t0 WHERE (t0.osType = ? OR t0.osType = ? OR t0.osType = ? OR > t0.osType = ? OR t0.osType = ? OR t0.osType = ?)" withBindings: > 1:"ALL"(osType), 2:"IOS"(osType), 3:"BB"(osType), 4:"ANDROID"(osType), > 5:"WIN8PHONE"(osType), 6:"WINDOWS"(osType)> > > > Which works! > > You da man like always! > > James > > > On Jan 26, 2013, at 6:48 PM, Chuck Hill <[email protected]> wrote: > >> Sounds like the root entity is not abstract or does not have a restricting >> qualifier. >> >> On 2013-01-26, at 4:43 PM, James Cicenia wrote: >> >>> OK - >>> >>> This is the SQL that is generated for >>> >>> NSArray<Notification> entries = >>> Notification.fetchAllNotifications(session().defaultEditingContext()); >>> >>> Notice that is first searches all the subclasses then the final query with >>> no osType qualifier. >>> >>> Doesn't make sense to me. >>> >>> >>> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT >>> RTRIM(t0.alertString), t0.appConfigIOSID, t0.appID, t0.badge, >>> RTRIM(t0.cronExpression), t0.dateCompleted, t0.dateCreated, t0.dateToPush, >>> t0.id, RTRIM(t0.message), t0.notificationAlertAppleID, RTRIM(t0.osType), >>> RTRIM(t0.sound), t0.status, RTRIM(t0.title) FROM Notification t0 WHERE >>> t0.osType = ?" withBindings: 1:"IOS"(osType)> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 1 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT >>> t0.appConfigBBID, t0.appID, RTRIM(t0.cronExpression), t0.dateCompleted, >>> t0.dateCreated, t0.dateToPush, t0.id, RTRIM(t0.message), RTRIM(t0.osType), >>> t0.status, RTRIM(t0.title) FROM Notification t0 WHERE t0.osType = ?" >>> withBindings: 1:"BB"(osType)> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 0 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT >>> t0.appConfigAndroidID, t0.appID, RTRIM(t0.cronExpression), >>> t0.dateCompleted, t0.dateCreated, t0.dateToPush, t0.id, RTRIM(t0.message), >>> RTRIM(t0.osType), t0.status, RTRIM(t0.title) FROM Notification t0 WHERE >>> t0.osType = ?" withBindings: 1:"ANDROID"(osType)> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 0 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT >>> t0.appConfigWinPhoneID, t0.appID, RTRIM(t0.cronExpression), >>> t0.dateCompleted, t0.dateCreated, t0.dateToPush, t0.id, RTRIM(t0.message), >>> RTRIM(t0.osType), t0.status, RTRIM(t0.title) FROM Notification t0 WHERE >>> t0.osType = ?" withBindings: 1:"WIN8PHONE"(osType)> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 0 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT >>> t0.appConfigWinID, t0.appID, RTRIM(t0.cronExpression), t0.dateCompleted, >>> t0.dateCreated, t0.dateToPush, t0.id, RTRIM(t0.message), RTRIM(t0.osType), >>> t0.status, RTRIM(t0.title) FROM Notification t0 WHERE t0.osType = ?" >>> withBindings: 1:"WINDOWS"(osType)> >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 0 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Begin Internal Transaction >>> DEBUG (ERXNSLogLog4jBridge.java:46) - evaluateExpression: >>> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT t0.appID, >>> RTRIM(t0.cronExpression), t0.dateCompleted, t0.dateCreated, t0.dateToPush, >>> t0.id, RTRIM(t0.message), RTRIM(t0.osType), t0.status, RTRIM(t0.title) FROM >>> Notification t0" withBindings: > >>> DEBUG (ERXNSLogLog4jBridge.java:46) - 1 row(s) processed >>> DEBUG (ERXNSLogLog4jBridge.java:46) - === Commit Internal Transaction >>> >>> On Jan 26, 2013, at 3:48 PM, Ken Anderson <[email protected]> wrote: >>> >>>> James, >>>> >>>> It would help to provide the definitions of the entities. It all depends >>>> on how you setup the restricting qualifiers and primary keys. Do all 3 >>>> have the same associated table? >>>> >>>> Ken >>>> >>>> On Jan 26, 2013, at 3:36 PM, James Cicenia <[email protected]> wrote: >>>> >>>>> OK - >>>>> >>>>> When I just the SQL... >>>>> >>>>> It actually does three selects and not one. >>>>> It does a select for each of the children entities and then for the >>>>> parent class. >>>>> >>>>> Why? I am just asking or fetching the parentClass. Why does it want to >>>>> also search by Qualifier of the subclasses? >>>>> >>>>> Thanks >>>>> James >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Do not post admin requests to the list. They will be ignored. >>>>> Webobjects-dev mailing list ([email protected]) >>>>> Help/Unsubscribe/Update your Subscription: >>>>> https://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com >>>>> >>>>> This email sent to [email protected] >>>> >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list ([email protected]) >>> Help/Unsubscribe/Update your Subscription: >>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >>> >>> This email sent to [email protected] >> >> -- >> Chuck Hill Senior Consultant / VP Development >> >> Practical WebObjects - for developers who want to increase their overall >> knowledge of WebObjects or who are trying to solve specific problems. >> http://www.global-village.net/gvc/practical_webobjects >> >> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest >> Growing Companies in B.C! >> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of >> Canada’s Fastest-Growing Companies by PROFIT Magazine! >> >> >> >> >> >> >> >> > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to [email protected] -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
