• 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: Sorting arrays nightmare (Solved by luck !)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting arrays nightmare (Solved by luck !)


  • Subject: Re: Sorting arrays nightmare (Solved by luck !)
  • From: Louis Demers <email@hidden>
  • Date: Sun, 20 Feb 2011 23:48:41 -0500

Sorry, to interrupt , but I turned on SQL logging and the and found that the EOModeler fetchspec that works genereates the following SQL

evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.assemblyTransaction_id, t0.averageCost, t0.billNumber, t0.contact_id, t0.cost, t0.dateEnd, t0.dateStart, t0.id, t0.location_id, t0.locked, t0.note, t0.part_id, t0.project_id, t0.purchaseOrder, t0.quantity, t0.receptionNumber, t0.reversedTransaction_id, t0.runningTotalCost, t0.runningTotalQty FROM Transaction t0 INNER JOIN Part T1 ON t0.part_id = T1.id WHERE T1.spec_id = ?::int4 ORDER BY t0.dateEnd ASC, t0.id ASC" withBindings: 1:4855(spec_id)>

while the non functioning EOModler fetchspec generates

evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.assemblyTransaction_id, t0.averageCost, t0.billNumber, t0.contact_id, t0.cost, t0.dateEnd, t0.dateStart, t0.id, t0.location_id, t0.locked, t0.note, t0.part_id, t0.project_id, t0.purchaseOrder, t0.quantity, t0.receptionNumber, t0.reversedTransaction_id, t0.runningTotalCost, t0.runningTotalQty FROM Transaction t0 INNER JOIN Part T1 ON t0.part_id = T1.id WHERE (T1.spec_id = ?::int4 AND t0.dateEnd < ?::timestamp) ORDER BY t0.dateEnd DESC, (t0.id)" withBindings: 1:4855(spec_id), 2:2011-01-25 14:07:36.0(dateEnd)>


While investigating, I toggled the sort orders of both fetchspecs and retested to see how it affected the generated SQL. After a few combinations, I noticed the EOModeler order started sticking and I was getting the desired sort ordering !

Feb 20 23:34:54 DEBUG NSLog  -  evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.assemblyTransaction_id, t0.averageCost, t0.billNumber, t0.contact_id, t0.cost, t0.dateEnd, t0.dateStart, t0.id, t0.location_id, t0.locked, t0.note, t0.part_id, t0.project_id, t0.purchaseOrder, t0.quantity, t0.receptionNumber, t0.reversedTransaction_id, t0.runningTotalCost, t0.runningTotalQty FROM Transaction t0 INNER JOIN Part T1 ON t0.part_id = T1.id WHERE (T1.spec_id = ?::int4 AND t0.dateEnd < ?::timestamp) ORDER BY t0.dateEnd DESC, t0.id DESC" withBindings: 1:4855(spec_id), 2:2011-01-25 14:07:36.0(dateEnd)>

So , good for now, but it seems like a possible bug in the Sort Orderings editor pane of EOModler. Next time this happens, I'll try to check the .fspec files to see if it matches EOModeler.

Cheers.


On 2011-02-20, at 21:46 , Louis Demers wrote:


On 2011-02-20, at 21:39 , Louis Demers wrote:

Please note that the sorting on the NSTimestamp seems to work, it's just that the sort on the primary does not when it's in reverse..


let me add that according to what I'm trying to do the latest should be the record with larger primary key on the same date
sot it should be last transaction on 2011-01-20



Louis Demers eng.
www.obzerv.com


 _______________________________________________
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: 
 >Sorting arrays nightmare (From: Louis Demers <email@hidden>)
 >Re: Sorting arrays nightmare (From: Q <email@hidden>)
 >Re: Sorting arrays nightmare (From: Louis Demers <email@hidden>)
 >Re: Sorting arrays nightmare (From: Louis Demers <email@hidden>)

  • Prev by Date: Re: Sorting arrays nightmare
  • Next by Date: WOWODC 2011: first batch of confirmed sessions
  • Previous by thread: Re: Sorting arrays nightmare
  • Next by thread: Dumb Deployment Question #6,467
  • Index(es):
    • Date
    • Thread