• 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
Re: more on the Vertical Inheritance, the sql
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more on the Vertical Inheritance, the sql


  • Subject: Re: more on the Vertical Inheritance, the sql
  • From: James Cicenia <email@hidden>
  • Date: Sat, 26 Jan 2013 18:43:44 -0600

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
  • Follow-Ups:
    • Re: more on the Vertical Inheritance, the sql
      • From: Chuck Hill <email@hidden>
References: 
 >more on the Vertical Inheritance, the sql (From: James Cicenia <email@hidden>)
 >Re: more on the Vertical Inheritance, the sql (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: more on the Vertical Inheritance, the sql
  • Next by Date: Re: more on the Single Table Inheritance, the sql
  • Previous by thread: Re: more on the Vertical Inheritance, the sql
  • Next by thread: Re: more on the Vertical Inheritance, the sql
  • Index(es):
    • Date
    • Thread