Re: more on the Vertical Inheritance, the sql
Re: more on the Vertical Inheritance, the sql
- Subject: Re: more on the Vertical Inheritance, the sql
- From: Chuck Hill <email@hidden>
- Date: Sat, 26 Jan 2013 16:48:54 -0800
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@hidden> 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@hidden> 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@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to 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
--
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden