delete_by_query

Open discussion on QxOrm library

delete_by_query

Postby Gurmeet Singh Gulati » Mon Mar 28, 2011 2:48 pm

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
Gurmeet Singh Gulati
 

Re: delete_by_query

Postby Gurmeet Singh Gulati » Mon Mar 28, 2011 2:52 pm

This is the bug
Gurmeet Singh Gulati
 

Re: delete_by_query

Postby QxOrm admin » Tue Mar 29, 2011 7:40 am

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);
QxOrm admin
 


Return to QxOrm - Open discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron