QueryBindings, Datasource and/or FetchSpecifications
QueryBindings, Datasource and/or FetchSpecifications
- Subject: QueryBindings, Datasource and/or FetchSpecifications
- From: James Cicenia <email@hidden>
- Date: Wed, 8 Feb 2006 21:18:00 -0600
Hello -
Well I have finally figured out how to save and retrieve my
queryBindings. Thanks to Travis Cripps I learned that the draggable
component, D2WQuery, isn't able to give QueryBindings back. However,
when I subclassed and integrated D2WQueryPage everything quickly fell
in place at which point Anjo's suggestion of ERD2WQueryPage become
very useful.
So now my question is, how do run a query directly with my stored
dictionary of QueryBindings?
I tried the following but to no avail:
public EODataSource queryDataSource(String entityName) {
EODataSource ds = null;
if (ds == null || !(ds instanceof EODatabaseDataSource)) {
ds = new EODatabaseDataSource(session
().defaultEditingContext(), entityName);
((EODatabaseDataSource)ds).setQualifierBindings
(((NSDictionary)((Session)session()).reportQueryDict()));
}
EOFetchSpecification fs = ((EODatabaseDataSource)
ds).fetchSpecification();
fs = fs.fetchSpecificationWithQualifierBindings
(((NSDictionary)((Session)session()).reportQueryDict()));
return ds;
}
I would then use something like:
queryDataSource(selectedReport.reportEntity()).fetchObjects()
This however always returns all objects as if no qualifier exists.
Any hints, suggestions or solutions would be greatly appreciated again.
Thanks,
James Cicenia
_______________________________________________
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