Page 1 of 1

delete_by_query

PostPosted: Mon Mar 28, 2011 2:48 pm
by Gurmeet Singh Gulati
delete_by_query() is not work.

The function in QxOrm/include/QxDao is :
Code: Select all
template <class T> inline QSqlError delete_by_query(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase){
   return qx::dao::QxDao_DeleteAll<T>::deleteAll(query, pDatabase);
}


If you try function with delete_by_query(query, (&db)); it will say no matching function.

In line (2) it is expecting template class T which is no-where in the expected parameters.
So, T will get unknown.

If use
return qx::dao::QxDao_DeleteAll<T>::deleteAll(query, pDatabase);
directly, instead of delete_by_query(), it will work

Re: delete_by_query

PostPosted: Mon Mar 28, 2011 2:52 pm
by Gurmeet Singh Gulati
This is the bug

Re: delete_by_query

PostPosted: Tue Mar 29, 2011 7:40 am
by QxOrm admin
Hi,

You have to specify the class you are using in the template function.
You have a sample in your QxOrm directory in the file : "./test/qxDllSample/exe/src/main.cpp" on the line 258 with the class "CUser".

Here the code of the sample :
Code: Select all
QSqlError daoError = qx::dao::delete_by_query<CUser>(sQuery1);