Re: EODisplaygroup sorting in database
Re: EODisplaygroup sorting in database
- Subject: Re: EODisplaygroup sorting in database
- From: Alexandre Mainville <email@hidden>
- Date: Mon, 4 Apr 2005 18:42:19 -0400
Thanks for the help guys.
Robert, kudos for your suggestion with the fetch specification in the model, exactly what I was looking for clean, simple AND reusable doesn't get much better...
Trying to work this out, I came across something strange. I started using
EOAdaptorDebugEnabled to trace the SQL calls and I noticed that on an update every field in the table is used in the WHERE clause.
[2005-04-04 18:15:04 EDT] <WorkerThread0> evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "UPDATE customer SET city = ?::text WHERE (customer_id = ?::int4 AND name = ?::text AND city = ?::text )
customer_id is a primary key for this table, it would have been sufficient on it's own, is this normal behavior for EOF or do I have something misconfigured?
Alex
On 4-Apr-05, at 2:16 PM, Robert Walker wrote:
Alexandre,
There are a couple ways I can think of to accomplish what you want.
The first method would be to define a fetch specification in your model then choose it for use with your data source.
Here is how you do that:
1. Open your interface (NIB) file in Interface Builder.
2. Show the inspector panel.
3. Select your display group from the "Instances" tab.
4. Select "Data Source" from the pop-up menu at the top of the inspector panel.
5. Select your fetch specification from the "Fetch Specification" pop-up in the inspector panel.
The second option is to use the query dictionaries (lessThanQueryValues(), greaterThanQueryValues(), & equalToQueryValues()) similar to WODisplayGroup. Then use qualifyDataSource() on the EODisplayGroup. In order to use this option you will need to create an outlet in Interface Builder, and also add the outlet's instance variable to your controller class. This will give you programatic access to your EODisplayGroup.
Hope this helps.
On Apr 4, 2005, at 12:02 PM, Alexandre Mainville wrote:
I'm just starting out with non direct java client development. I have a really simple one-to-many relationship (customer -> shipto adresses) and I'm trying to build a custom interface for it. I can't find a way to specify sort orders.
I read about sortOrderings but I believe that sorts in memory and what I'm looking for is a way to specify the ORDER BY clause in the fetch statement.
I'm thinking about unchecking "Fetch on Load", fetching manually and doing a setObjectArray but that just doesn't feel right, is there a better way?
Thanks
Alex _______________________________________________
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
--
Robert Walker
Bennett Technology Group
(770) 957-1866 Ext: 790
_______________________________________________
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