Hi,
I found that third parameter is column array that will be updated.
Yes here is the signature of
qx::dao::update function :
QSqlError qx::dao::update (T & t, QSqlDatabase * pDatabase = NULL, const QStringList &columns = QStringList())So if you provide a list of columns to the third parameter, the function will update only columns of your choice.
How can i exclude field from update ?
Using
qx::dao::update function, you can't : you have to pass a list of columns to include to your query (and not to exclude).
How can i get list of fields if QxClass ?
You can retrieve a list of columns for a specific class using introspection engine of QxOrm library.
More details in the FAQ, here :
http://www.qxorm.com/qxorm_en/faq.html#faq_190This code could help you :
- Code: Select all
QString IxClass::dumpClass() const
{
QString sDump;
sDump += "-- class '" + m_sKey + "' (name '" + m_sName + "', ";
sDump += "description '" + m_sDescription + "', version '" + QString::number(m_lVersion) + "', ";
sDump += "base class '" + (getBaseClass() ? getBaseClass()->getKey() : "") + "')\n";
long lCount = (m_pDataMemberX ? m_pDataMemberX->count() : 0);
sDump += "\t* list of registered properties (" + QString::number(lCount) + ")\n";
if (m_pDataMemberX)
{
IxDataMember * pId = this->getId();
for (long l = 0; l < lCount; l++)
{
IxDataMember * p = m_pDataMemberX->get(l); if (! p) { continue; }
IxSqlRelation * pRelation = p->getSqlRelation();
QString sInfos = p->getKey() + ((p == pId) ? QString(" (id)") : QString());
sInfos += (pRelation ? (QString(" (") + pRelation->getDescription() + QString(")")) : QString());
sDump += "\t\t" + sInfos + "\n";
}
}
// etc...