Cactivedataprovider With Custom Sql

I have a rather complex query that uses sub-selects and joins that have sub-selects.

Since it is difficult to create this query using CDbCriteria, I was wondering if there is any way that we can pass in the custom query into CActiveDataProvider, possibly using findAllBySql or something similar?

Have you tried CSqlDataProvider?

OK just tried CSqlDataProvider - this works OK - however is it possible to return the data as model objects rather than a row array?

Alternatively, is it possible to use the result of a findAllBySql() with a CACtiveDataProvider?

Anybody have any ideas for this?