DbCriteria vs findBySql

What’s the difference between:




cat=new CDbCriteria();

                $cat->select="*";

                $cat->order="name ASC";

Categoria::model()->findAll($cat);



and




Categoria::model()->findBySQL("select * from categoria order by name ASC");



as far as i know basically not much

but cdbcriteria helps you to avoid writing sql

i stopped using findbysql since you can really do everything

without it (together, etc.) which is pretty neat. i dont know if there is a performance impact

maybe a more experienced user can elaborate more.

also i found a similar thread:

http://www.yiiframework.com/forum/index.php/topic/15253-cdbcriteria-vs-findbysql/