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 <kenli...@anderhome.com> 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 <ja...@jimijon.com> 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      (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com
>> 
>> This email sent to kenli...@anderhome.com
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to