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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to