text: /**
  	* \file WzskQUsgList.cpp
  	* Dbs and XML wrapper for table TblWzskQUsgList (implementation)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Emily Johnson (auto-generation)
  	* \date created: 5 Dec 2020
    */
  // IP header --- ABOVE
  
  #include "WzskQUsgList.h"
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class WzskQUsgList
   ******************************************************************************/
  
  WzskQUsgList::WzskQUsgList(
  			const ubigint qref
  			, const ubigint jref
  			, const uint jnum
  			, const ubigint ref
  			, const ubigint grp
  			, const string stubGrp
  			, const ubigint own
  			, const string stubOwn
  			, const string sref
  		) {
  	this->qref = qref;
  	this->jref = jref;
  	this->jnum = jnum;
  	this->ref = ref;
  	this->grp = grp;
  	this->stubGrp = stubGrp;
  	this->own = own;
  	this->stubOwn = stubOwn;
  	this->sref = sref;
  };
  
  void WzskQUsgList::writeJSON(
  			Json::Value& sup
  			, bool jnumattr
  			, bool shorttags
  		) {
  	Json::Value& me = sup.append(Json::Value(Json::objectValue));
  
  	if (jnumattr) me["jnum"] = jnum;
  	if (shorttags) {
  		me["grp"] = stubGrp;
  		me["own"] = stubOwn;
  		me["srf"] = sref;
  	} else {
  		me["stubGrp"] = stubGrp;
  		me["stubOwn"] = stubOwn;
  		me["sref"] = sref;
  	};
  };
  
  void WzskQUsgList::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool jnumattr
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "WzskQUsgList";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  	if (jnumattr) xmlTextWriterWriteAttribute(wr, BAD_CAST "jnum", BAD_CAST to_string(jnum).c_str());
  	if (shorttags) {
  		writeString(wr, "grp", stubGrp);
  		writeString(wr, "own", stubOwn);
  		writeString(wr, "srf", sref);
  	} else {
  		writeString(wr, "stubGrp", stubGrp);
  		writeString(wr, "stubOwn", stubOwn);
  		writeString(wr, "sref", sref);
  	};
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class ListWzskQUsgList
   ******************************************************************************/
  
  ListWzskQUsgList::ListWzskQUsgList() {
  };
  
  ListWzskQUsgList::ListWzskQUsgList(
  			const ListWzskQUsgList& src
  		) {
  	nodes.resize(src.nodes.size(), NULL);
  	for (unsigned int i = 0; i < nodes.size(); i++) nodes[i] = new WzskQUsgList(*(src.nodes[i]));
  };
  
  ListWzskQUsgList::~ListWzskQUsgList() {
  	clear();
  };
  
  void ListWzskQUsgList::clear() {
  	for (unsigned int i = 0; i < nodes.size(); i++) if (nodes[i]) delete nodes[i];
  	nodes.resize(0);
  };
  
  unsigned int ListWzskQUsgList::size() const {
  	return(nodes.size());
  };
  
  void ListWzskQUsgList::append(
  			WzskQUsgList* rec
  		) {
  	nodes.push_back(rec);
  };
  
  ListWzskQUsgList& ListWzskQUsgList::operator=(
  			const ListWzskQUsgList& src
  		) {
  	WzskQUsgList* rec;
  
  	if (&src != this) {
  		clear();
  		for (unsigned int i = 0; i < src.size(); i++) {
  			rec = new WzskQUsgList(*(src.nodes[i]));
  			nodes.push_back(rec);
  		};
  	};
  
  	return(*this);
  };
  
  void ListWzskQUsgList::writeJSON(
  			Json::Value& sup
  			, std::string difftag
  		) {
  	if (difftag == "") difftag = "ListWzskQUsgList";
  
  	Json::Value& me = sup[difftag] = Json::Value(Json::arrayValue);
  	for (unsigned int i = 0; i < nodes.size(); i++) nodes[i]->writeJSON(me, true, true);
  };
  
  void ListWzskQUsgList::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  		) {
  	// generate top XML tag
  	if (difftag.length() == 0) difftag = "ListWzskQUsgList";
  
  	// XML output
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		for (unsigned int i = 0; i < nodes.size(); i++) nodes[i]->writeXML(wr, "row", true, true);
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class TblWzskQUsgList
   ******************************************************************************/
  
  TblWzskQUsgList::TblWzskQUsgList() {
  };
  
  TblWzskQUsgList::~TblWzskQUsgList() {
  };
  
  bool TblWzskQUsgList::loadRecBySQL(
  			const string& sqlstr
  			, WzskQUsgList** rec
  		) {
  	return false;
  };
  
  ubigint TblWzskQUsgList::loadRstBySQL(
  			const string& sqlstr
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	return 0;
  };
  
  ubigint TblWzskQUsgList::insertRec(
  			WzskQUsgList* rec
  		) {
  	return 0;
  };
  
  ubigint TblWzskQUsgList::insertNewRec(
  			WzskQUsgList** rec
  			, const ubigint jref
  			, const uint jnum
  			, const ubigint ref
  			, const ubigint grp
  			, const string stubGrp
  			, const ubigint own
  			, const string stubOwn
  			, const string sref
  		) {
  	ubigint retval = 0;
  	WzskQUsgList* _rec = NULL;
  
  	_rec = new WzskQUsgList(0, jref, jnum, ref, grp, stubGrp, own, stubOwn, sref);
  	insertRec(_rec);
  
  	retval = _rec->qref;
  
  	if (rec == NULL) delete _rec;
  	else *rec = _rec;
  
  	return retval;
  };
  
  ubigint TblWzskQUsgList::appendNewRecToRst(
  			ListWzskQUsgList& rst
  			, WzskQUsgList** rec
  			, const ubigint jref
  			, const uint jnum
  			, const ubigint ref
  			, const ubigint grp
  			, const string stubGrp
  			, const ubigint own
  			, const string stubOwn
  			, const string sref
  		) {
  	ubigint retval = 0;
  	WzskQUsgList* _rec = NULL;
  
  	retval = insertNewRec(&_rec, jref, jnum, ref, grp, stubGrp, own, stubOwn, sref);
  	rst.nodes.push_back(_rec);
  
  	if (rec != NULL) *rec = _rec;
  
  	return retval;
  };
  
  void TblWzskQUsgList::insertRst(
  			ListWzskQUsgList& rst
  		) {
  };
  
  void TblWzskQUsgList::updateRec(
  			WzskQUsgList* rec
  		) {
  };
  
  void TblWzskQUsgList::updateRst(
  			ListWzskQUsgList& rst
  		) {
  };
  
  void TblWzskQUsgList::removeRecByQref(
  			ubigint qref
  		) {
  };
  
  void TblWzskQUsgList::removeRstByJref(
  			ubigint jref
  		) {
  };
  
  bool TblWzskQUsgList::loadRecByQref(
  			ubigint qref
  			, WzskQUsgList** rec
  		) {
  	return false;
  };
  
  ubigint TblWzskQUsgList::loadRstByJref(
  			ubigint jref
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	return 0;
  };
  
  #if defined(SBECORE_MAR) || defined(SBECORE_MY)
  /******************************************************************************
   class MyTblWzskQUsgList
   ******************************************************************************/
  
  MyTblWzskQUsgList::MyTblWzskQUsgList() :
  			TblWzskQUsgList()
  			, MyTable()
  		{
  	stmtInsertRec = NULL;
  	stmtUpdateRec = NULL;
  	stmtRemoveRecByQref = NULL;
  	stmtRemoveRstByJref = NULL;
  };
  
  MyTblWzskQUsgList::~MyTblWzskQUsgList() {
  	if (stmtInsertRec) delete(stmtInsertRec);
  	if (stmtUpdateRec) delete(stmtUpdateRec);
  	if (stmtRemoveRecByQref) delete(stmtRemoveRecByQref);
  	if (stmtRemoveRstByJref) delete(stmtRemoveRstByJref);
  };
  
  void MyTblWzskQUsgList::initStatements() {
  	stmtInsertRec = createStatement("INSERT INTO TblWzskQUsgList (jref, jnum, ref, grp, own, sref) VALUES (?,?,?,?,?,?)", false);
  	stmtUpdateRec = createStatement("UPDATE TblWzskQUsgList SET jref = ?, jnum = ?, ref = ?, grp = ?, own = ?, sref = ? WHERE qref = ?", false);
  	stmtRemoveRecByQref = createStatement("DELETE FROM TblWzskQUsgList WHERE qref = ?", false);
  	stmtRemoveRstByJref = createStatement("DELETE FROM TblWzskQUsgList WHERE jref = ?", false);
  };
  
  bool MyTblWzskQUsgList::loadRecBySQL(
  			const string& sqlstr
  			, WzskQUsgList** rec
  		) {
  	MYSQL_RES* dbresult; MYSQL_ROW dbrow;
  	WzskQUsgList* _rec = NULL;
  
  	bool retval = false;
  
  	if (mysql_real_query(dbs, sqlstr.c_str(), sqlstr.length())) {
  		string dbms = "MyTblWzskQUsgList::loadRecBySQL() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	dbresult = mysql_store_result(dbs);
  	if (!dbresult) {
  		string dbms = "MyTblWzskQUsgList::loadRecBySQL() / store result / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	if (mysql_num_rows(dbresult) == 1) {
  		dbrow = mysql_fetch_row(dbresult);
  		unsigned long* dblengths = mysql_fetch_lengths(dbresult);
  
  		_rec = new WzskQUsgList();
  
  		if (dbrow[0]) _rec->qref = atoll((char*) dbrow[0]); else _rec->qref = 0;
  		if (dbrow[1]) _rec->jref = atoll((char*) dbrow[1]); else _rec->jref = 0;
  		if (dbrow[2]) _rec->jnum = atol((char*) dbrow[2]); else _rec->jnum = 0;
  		if (dbrow[3]) _rec->ref = atoll((char*) dbrow[3]); else _rec->ref = 0;
  		if (dbrow[4]) _rec->grp = atoll((char*) dbrow[4]); else _rec->grp = 0;
  		if (dbrow[5]) _rec->own = atoll((char*) dbrow[5]); else _rec->own = 0;
  		if (dbrow[6]) _rec->sref.assign(dbrow[6], dblengths[6]); else _rec->sref = "";
  
  		retval = true;
  	};
  
  	mysql_free_result(dbresult);
  
  	*rec = _rec;
  	return retval;
  };
  
  ubigint MyTblWzskQUsgList::loadRstBySQL(
  			const string& sqlstr
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	MYSQL_RES* dbresult; MYSQL_ROW dbrow; ubigint numrow; ubigint numread = 0;
  	WzskQUsgList* rec;
  
  	if (!append) rst.clear();
  
  	if (mysql_real_query(dbs, sqlstr.c_str(), sqlstr.length())) {
  		string dbms = "MyTblWzskQUsgList::loadRstBySQL() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	dbresult = mysql_store_result(dbs);
  	if (!dbresult) {
  		string dbms = "MyTblWzskQUsgList::loadRstBySQL() / store result / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	numrow = mysql_num_rows(dbresult);
  
  	if (numrow > 0) {
  		rst.nodes.reserve(rst.nodes.size() + numrow);
  
  		while (numread < numrow) {
  			dbrow = mysql_fetch_row(dbresult);
  			unsigned long* dblengths = mysql_fetch_lengths(dbresult);
  
  			rec = new WzskQUsgList();
  
  			if (dbrow[0]) rec->qref = atoll((char*) dbrow[0]); else rec->qref = 0;
  			if (dbrow[1]) rec->jref = atoll((char*) dbrow[1]); else rec->jref = 0;
  			if (dbrow[2]) rec->jnum = atol((char*) dbrow[2]); else rec->jnum = 0;
  			if (dbrow[3]) rec->ref = atoll((char*) dbrow[3]); else rec->ref = 0;
  			if (dbrow[4]) rec->grp = atoll((char*) dbrow[4]); else rec->grp = 0;
  			if (dbrow[5]) rec->own = atoll((char*) dbrow[5]); else rec->own = 0;
  			if (dbrow[6]) rec->sref.assign(dbrow[6], dblengths[6]); else rec->sref = "";
  			rst.nodes.push_back(rec);
  
  			numread++;
  		};
  	};
  
  	mysql_free_result(dbresult);
  
  	return(numread);
  };
  
  ubigint MyTblWzskQUsgList::insertRec(
  			WzskQUsgList* rec
  		) {
  	unsigned long l[6]; my_bool n[6]; my_bool e[6];
  
  	l[5] = rec->sref.length();
  
  	MYSQL_BIND bind[] = {
  		bindUbigint(&rec->jref,&(l[0]),&(n[0]),&(e[0])),
  		bindUint(&rec->jnum,&(l[1]),&(n[1]),&(e[1])),
  		bindUbigint(&rec->ref,&(l[2]),&(n[2]),&(e[2])),
  		bindUbigint(&rec->grp,&(l[3]),&(n[3]),&(e[3])),
  		bindUbigint(&rec->own,&(l[4]),&(n[4]),&(e[4])),
  		bindCstring((char*) (rec->sref.c_str()),&(l[5]),&(n[5]),&(e[5]))
  	};
  
  	if (mysql_stmt_bind_param(stmtInsertRec, bind)) {
  		string dbms = "MyTblWzskQUsgList::insertRec() / bind / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  	if (mysql_stmt_execute(stmtInsertRec)) {
  		string dbms = "MyTblWzskQUsgList::insertRec() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  	rec->qref = mysql_stmt_insert_id(stmtInsertRec);
  	
  	return rec->qref;
  };
  
  void MyTblWzskQUsgList::insertRst(
  			ListWzskQUsgList& rst
  		) {
  	for (unsigned int i = 0; i < rst.nodes.size(); i++) insertRec(rst.nodes[i]);
  };
  
  void MyTblWzskQUsgList::updateRec(
  			WzskQUsgList* rec
  		) {
  	unsigned long l[7]; my_bool n[7]; my_bool e[7];
  
  	l[5] = rec->sref.length();
  
  	MYSQL_BIND bind[] = {
  		bindUbigint(&rec->jref,&(l[0]),&(n[0]),&(e[0])),
  		bindUint(&rec->jnum,&(l[1]),&(n[1]),&(e[1])),
  		bindUbigint(&rec->ref,&(l[2]),&(n[2]),&(e[2])),
  		bindUbigint(&rec->grp,&(l[3]),&(n[3]),&(e[3])),
  		bindUbigint(&rec->own,&(l[4]),&(n[4]),&(e[4])),
  		bindCstring((char*) (rec->sref.c_str()),&(l[5]),&(n[5]),&(e[5])),
  		bindUbigint(&rec->qref,&(l[6]),&(n[6]),&(e[6]))
  	};
  
  	if (mysql_stmt_bind_param(stmtUpdateRec, bind)) {
  		string dbms = "MyTblWzskQUsgList::updateRec() / bind / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  	if (mysql_stmt_execute(stmtUpdateRec)) {
  		string dbms = "MyTblWzskQUsgList::updateRec() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  };
  
  void MyTblWzskQUsgList::updateRst(
  			ListWzskQUsgList& rst
  		) {
  	for (unsigned int i = 0; i < rst.nodes.size(); i++) updateRec(rst.nodes[i]);
  };
  
  void MyTblWzskQUsgList::removeRecByQref(
  			ubigint qref
  		) {
  	unsigned long l; my_bool n; my_bool e;
  
  	MYSQL_BIND bind = bindUbigint(&qref,&l,&n,&e);
  
  	if (mysql_stmt_bind_param(stmtRemoveRecByQref, &bind)) {
  		string dbms = "MyTblWzskQUsgList::removeRecByQref() / bind / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  	if (mysql_stmt_execute(stmtRemoveRecByQref)) {
  		string dbms = "MyTblWzskQUsgList::removeRecByQref() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  };
  
  void MyTblWzskQUsgList::removeRstByJref(
  			ubigint jref
  		) {
  	unsigned long l; my_bool n; my_bool e;
  
  	MYSQL_BIND bind = bindUbigint(&jref,&l,&n,&e);
  
  	if (mysql_stmt_bind_param(stmtRemoveRstByJref, &bind)) {
  		string dbms = "MyTblWzskQUsgList::removeRstByJref() / bind / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  	if (mysql_stmt_execute(stmtRemoveRstByJref)) {
  		string dbms = "MyTblWzskQUsgList::removeRstByJref() / " + string(mysql_error(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  };
  
  bool MyTblWzskQUsgList::loadRecByQref(
  			ubigint qref
  			, WzskQUsgList** rec
  		) {
  	if (qref == 0) {
  		*rec = NULL;
  		return false;
  	};
  
  	return loadRecBySQL("SELECT * FROM TblWzskQUsgList WHERE qref = " + to_string(qref), rec);
  };
  
  ubigint MyTblWzskQUsgList::loadRstByJref(
  			ubigint jref
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	return loadRstBySQL("SELECT * FROM TblWzskQUsgList WHERE jref = " + to_string(jref) + " ORDER BY jnum ASC", append, rst);
  };
  #endif
  
  #if defined(SBECORE_LITE)
  /******************************************************************************
   class LiteTblWzskQUsgList
   ******************************************************************************/
  
  LiteTblWzskQUsgList::LiteTblWzskQUsgList() :
  			TblWzskQUsgList()
  			, LiteTable()
  		{
  	stmtInsertRec = NULL;
  	stmtUpdateRec = NULL;
  	stmtRemoveRecByQref = NULL;
  	stmtRemoveRstByJref = NULL;
  
  	stmtLoadRecByQref = NULL;
  	stmtLoadRecByJref = NULL;
  	stmtLoadRstByJref = NULL;
  };
  
  LiteTblWzskQUsgList::~LiteTblWzskQUsgList() {
  	if (stmtInsertRec) sqlite3_finalize(stmtInsertRec);
  	if (stmtUpdateRec) sqlite3_finalize(stmtUpdateRec);
  	if (stmtRemoveRecByQref) sqlite3_finalize(stmtRemoveRecByQref);
  	if (stmtRemoveRstByJref) sqlite3_finalize(stmtRemoveRstByJref);
  
  	if (stmtLoadRecByQref) sqlite3_finalize(stmtLoadRecByQref);
  	if (stmtLoadRecByJref) sqlite3_finalize(stmtLoadRecByJref);
  	if (stmtLoadRstByJref) sqlite3_finalize(stmtLoadRstByJref);
  };
  
  void LiteTblWzskQUsgList::initStatements() {
  	stmtInsertRec = createStatement("INSERT INTO TblWzskQUsgList (jref, jnum, ref, grp, own, sref) VALUES (?1,?2,?3,?4,?5,?6)");
  	stmtUpdateRec = createStatement("UPDATE TblWzskQUsgList SET jref = ?1, jnum = ?2, ref = ?3, grp = ?4, own = ?5, sref = ?6 WHERE qref = ?7");
  	stmtRemoveRecByQref = createStatement("DELETE FROM TblWzskQUsgList WHERE qref = ?1");
  	stmtRemoveRstByJref = createStatement("DELETE FROM TblWzskQUsgList WHERE jref = ?1");
  
  	stmtLoadRecByQref = createStatement("SELECT qref, jref, jnum, ref, grp, own, sref FROM TblWzskQUsgList WHERE qref = ?1");
  	stmtLoadRstByJref = createStatement("SELECT qref, jref, jnum, ref, grp, own, sref FROM TblWzskQUsgList WHERE jref = ?1 ORDER BY jnum ASC");
  };
  
  bool LiteTblWzskQUsgList::loadRec(
  			sqlite3_stmt* stmt
  			, WzskQUsgList** rec
  		) {
  	int res;
  
  	WzskQUsgList* _rec = NULL;
  	bool retval = false;
  
  	res = sqlite3_step(stmt);
  	if (res == SQLITE_ROW) {
  		_rec = new WzskQUsgList();
  
  		_rec->qref = sqlite3_column_int64(stmt, 0);
  		_rec->jref = sqlite3_column_int64(stmt, 1);
  		_rec->jnum = sqlite3_column_int(stmt, 2);
  		_rec->ref = sqlite3_column_int64(stmt, 3);
  		_rec->grp = sqlite3_column_int64(stmt, 4);
  		_rec->own = sqlite3_column_int64(stmt, 5);
  		_rec->sref.assign((const char*) sqlite3_column_text(stmt, 6));
  
  		res = sqlite3_step(stmt);
  		if (res == SQLITE_DONE) {
  			*rec = _rec;
  			retval = true;
  		} else {
  			delete _rec;
  		};
  	};
  
  	return retval;
  };
  
  ubigint LiteTblWzskQUsgList::loadRst(
  			sqlite3_stmt* stmt
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	int res; ubigint numread = 0;
  
  	WzskQUsgList* rec;
  
  	if (!append) rst.clear();
  
  	res = sqlite3_step(stmt);
  	while (res == SQLITE_ROW) {
  		rec = new WzskQUsgList();
  
  		rec->qref = sqlite3_column_int64(stmt, 0);
  		rec->jref = sqlite3_column_int64(stmt, 1);
  		rec->jnum = sqlite3_column_int(stmt, 2);
  		rec->ref = sqlite3_column_int64(stmt, 3);
  		rec->grp = sqlite3_column_int64(stmt, 4);
  		rec->own = sqlite3_column_int64(stmt, 5);
  		rec->sref.assign((const char*) sqlite3_column_text(stmt, 6));
  
  		rst.nodes.push_back(rec);
  
  		numread++;
  
  		res = sqlite3_step(stmt);
  	};
  
  	return(numread);
  };
  
  bool LiteTblWzskQUsgList::loadRecByStmt(
  			sqlite3_stmt* stmt
  			, WzskQUsgList** rec
  		) {
  	bool retval = loadRec(stmt, rec);
  
  	sqlite3_reset(stmt);
  
  	return retval;
  };
  
  ubigint LiteTblWzskQUsgList::loadRstByStmt(
  			sqlite3_stmt* stmt
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	ubigint retval = loadRst(stmt, append, rst);
  
  	sqlite3_reset(stmt);
  
  	return retval;
  };
  
  bool LiteTblWzskQUsgList::loadRecBySQL(
  			const string& sqlstr
  			, WzskQUsgList** rec
  		) {
  	int res;
  	sqlite3_stmt* stmt;
  
  	bool retval = false;
  
  	res = sqlite3_prepare_v2(dbs, sqlstr.c_str(), sqlstr.length()+1, &stmt, NULL);
  	if (res != SQLITE_OK) {
  		string dbms = "LiteTblWzskQUsgList::loadRecBySQL() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	retval = loadRec(stmt, rec);
  
  	sqlite3_finalize(stmt);
  
  	return retval;
  };
  
  ubigint LiteTblWzskQUsgList::loadRstBySQL(
  			const string& sqlstr
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	int res;
  	sqlite3_stmt* stmt;
  
  	ubigint retval = 0;
  
  	res = sqlite3_prepare_v2(dbs, sqlstr.c_str(), sqlstr.length()+1, &stmt, NULL);
  	if (res != SQLITE_OK) {
  		string dbms = "LiteTblWzskQUsgList::loadRstBySQL() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_QUERY, {{"dbms",dbms}, {"sql",sqlstr}});
  	};
  
  	retval = loadRst(stmt, append, rst);
  
  	sqlite3_finalize(stmt);
  
  	return retval;
  };
  
  ubigint LiteTblWzskQUsgList::insertRec(
  			WzskQUsgList* rec
  		) {
  	sqlite3_bind_int64(stmtInsertRec, 1, rec->jref);
  	sqlite3_bind_int(stmtInsertRec, 2, rec->jnum);
  	sqlite3_bind_int64(stmtInsertRec, 3, rec->ref);
  	sqlite3_bind_int64(stmtInsertRec, 4, rec->grp);
  	sqlite3_bind_int64(stmtInsertRec, 5, rec->own);
  	sqlite3_bind_text(stmtInsertRec, 6, rec->sref.c_str(), rec->sref.length(), SQLITE_STATIC);
  
  	if (sqlite3_step(stmtInsertRec) != SQLITE_DONE)	{
  		string dbms = "LiteTblWzskQUsgList::insertRec() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  
  	rec->qref = sqlite3_last_insert_rowid(dbs);
  
  	sqlite3_reset(stmtInsertRec);
  	
  	return rec->qref;
  };
  
  void LiteTblWzskQUsgList::insertRst(
  			ListWzskQUsgList& rst
  		) {
  	for (unsigned int i = 0; i < rst.nodes.size(); i++) insertRec(rst.nodes[i]);
  };
  
  void LiteTblWzskQUsgList::updateRec(
  			WzskQUsgList* rec
  		) {
  	sqlite3_bind_int64(stmtUpdateRec, 1, rec->jref);
  	sqlite3_bind_int(stmtUpdateRec, 2, rec->jnum);
  	sqlite3_bind_int64(stmtUpdateRec, 3, rec->ref);
  	sqlite3_bind_int64(stmtUpdateRec, 4, rec->grp);
  	sqlite3_bind_int64(stmtUpdateRec, 5, rec->own);
  	sqlite3_bind_text(stmtUpdateRec, 6, rec->sref.c_str(), rec->sref.length(), SQLITE_STATIC);
  	sqlite3_bind_int64(stmtUpdateRec, 7, rec->qref);
  
  	if (sqlite3_step(stmtUpdateRec) != SQLITE_DONE)	{
  		string dbms = "LiteTblWzskQUsgList::updateRec() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  
  	sqlite3_reset(stmtUpdateRec);
  };
  
  void LiteTblWzskQUsgList::updateRst(
  			ListWzskQUsgList& rst
  		) {
  	for (unsigned int i = 0; i < rst.nodes.size(); i++) updateRec(rst.nodes[i]);
  };
  
  void LiteTblWzskQUsgList::removeRecByQref(
  			ubigint qref
  		) {
  	sqlite3_bind_int64(stmtRemoveRecByQref, 1, qref);
  
  	if (sqlite3_step(stmtRemoveRecByQref) != SQLITE_DONE)	{
  		string dbms = "LiteTblWzskQUsgList::removeRecByQref() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  
  	sqlite3_reset(stmtRemoveRecByQref);
  };
  
  void LiteTblWzskQUsgList::removeRstByJref(
  			ubigint jref
  		) {
  	sqlite3_bind_int64(stmtRemoveRstByJref, 1, jref);
  
  	if (sqlite3_step(stmtRemoveRstByJref) != SQLITE_DONE)	{
  		string dbms = "LiteTblWzskQUsgList::removeRstByJref() / " + string(sqlite3_errmsg(dbs));
  		throw SbeException(SbeException::DBS_STMTEXEC, {{"dbms",dbms}});
  	};
  
  	sqlite3_reset(stmtRemoveRstByJref);
  };
  
  bool LiteTblWzskQUsgList::loadRecByQref(
  			ubigint qref
  			, WzskQUsgList** rec
  		) {
  	if (qref == 0) {
  		*rec = NULL;
  		return false;
  	};
  
  	sqlite3_bind_int64(stmtLoadRecByQref, 1, qref);
  
  	return loadRecByStmt(stmtLoadRecByQref, rec);
  };
  
  ubigint LiteTblWzskQUsgList::loadRstByJref(
  			ubigint jref
  			, const bool append
  			, ListWzskQUsgList& rst
  		) {
  	sqlite3_bind_int64(stmtLoadRstByJref, 1, jref);
  
  	return loadRstByStmt(stmtLoadRstByJref, append, rst);
  };
  #endif
  