• 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
Weird Sorting issue mentioned in D2W Locking Error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird Sorting issue mentioned in D2W Locking Error


  • Subject: Weird Sorting issue mentioned in D2W Locking Error
  • From: "Andrew R. Kinnie" <email@hidden>
  • Date: Thu, 02 Dec 2010 10:05:58 -0500

OK, I am not 100% sure about the inner/outer thing as I'm not really an SQL guy.  From what I understand, an inner is essentially the same as 
select * from booking b, performance p where b.performanceid = p.id 

or

select * from booking b
inner join performance p on b.performanceid = p.id 

whereas outer would include all the performances regardless of whether there is a match.

Are you saying such a sort ordering should use an outer join?  (which from my understanding includes all the performances whether or not they match this booking?)  
In this case, as PerformanceType is basically a lookup table with 3 rows, I'd want to sort on all the bookings on a given date, based on the booking's performance's performanceType, in descending order of the performanceType's displayOrder.

As I obviously want to be able to ask a performance what it's performanceType is, I'd presumably only want to match the to-one performanceType for that performance, and not all of them, so I'm not clear how I should change this.

My current running code:

public NSArray<Booking> upcomingEvents() {
NSTimestamp now = new NSTimestamp();
EOSortOrdering dateOrdering = Booking.EVENT_DATE.asc();
NSArray<Booking> events = Booking.fetchBookings(editingContext(), Booking.EVENT_DATE.after(now).and(Booking.EVENT_DATE.before((NSTimestamp)now.timestampByAddingGregorianUnits(0, 0, daysAhead, 0, 0, 0))), new NSArray<EOSortOrdering>(dateOrdering));
return events;
}

sorts all the bookings including acts on a given date that are of 3 different type, but (obviously) only on eventDate (so the headliner might not appear above the feature, or specialEvent

While:

public NSArray<Booking> upcomingEvents() {
NSTimestamp now = new NSTimestamp();
EOSortOrdering dateOrdering = Booking.EVENT_DATE.asc();
     EOSortOrdering performanceTypeOrdering =  Booking.PERFORMANCE.dot(Performance.PERFORMANCE_TYPE.dot(PerformanceType.DISPLAY_ORDER)).desc();

NSArray<Booking> events = Booking.fetchBookings(editingContext(), Booking.EVENT_DATE.after(now).and(Booking.EVENT_DATE.before((NSTimestamp)now.timestampByAddingGregorianUnits(0, 0, daysAhead, 0, 0, 0))), new NSArray<EOSortOrdering>(dateOrdering, performanceTypeOrdering));

return events;
}

Sorts, appropriately, but for some reason leaves out the feature completely.

The relationship from booking -> performance is a to one, then from performance -> performanceType is also a to one, and the reverse relationships are all inner joins currently.  (e.g. I want the performance asso

On Dec 1, 2010, at 10:10 PM, Chuck Hill wrote:


On Dec 1, 2010, at 6:56 PM, Andrew R. Kinnie wrote:

OK, well I did that, and even re-booted the machine.  No change.

In other news if I eliminate my second sort ordering, the previously missing booking appears.

That sounds like maybe you have a inner join where you want an outer join.


I changed it to use ERXSortOrdering and get the same result.

I need a beer.

Under these circumstances I'd suggest BrennivĂ­n and lots of it.  I'll leave the inclusion of fermented shark to your own discretion.


Chuck

 _______________________________________________
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

References: 
 >D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Pascal Robert <email@hidden>)
 >Re: D2W locking error (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: D2W locking error (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: SQLSERVER PlugIn for WebObjects
  • Next by Date: Windows 2008 64bits deployment
  • Previous by thread: Re: D2W locking error
  • Next by thread: Re: Weird Sorting issue mentioned in D2W Locking Error - probably fixed
  • Index(es):
    • Date
    • Thread