mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-10-13 03:13:11 -04:00
first try at nesting code, minus the actual insert
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
// ======================================================================
|
||||
//
|
||||
// TaskMapAccount.cpp
|
||||
// copyright (c) 2001 Sony Online Entertainment
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#include "FirstLoginServer.h"
|
||||
#include "TaskMapAccount.h"
|
||||
|
||||
#include "ClientConnection.h"
|
||||
#include "DatabaseConnection.h"
|
||||
#include "sharedDatabaseInterface/DbSession.h"
|
||||
|
||||
// ======================================================================
|
||||
|
||||
TaskMapAccount::TaskMapAccount(StationId parentID, StationId childID) :
|
||||
TaskRequest(),
|
||||
m_parentID(parentID),
|
||||
m_childID(childID)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool TaskMapAccount::process(DB::Session *session)
|
||||
{
|
||||
MapAccountQuery qry;
|
||||
qry.parentID=m_parentId;
|
||||
qry.childID=m_childId;
|
||||
|
||||
bool rval = session->exec(&qry);
|
||||
|
||||
qry.done();
|
||||
return rval;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void TaskMapAccount::onComplete()
|
||||
{
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
TaskMapAccount::MapAccountQuery::MapAccountQuery() :
|
||||
Query(),
|
||||
parentID(),
|
||||
childID()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void TaskMapAccount::MapAccountQuery::getSQL(std::string &sql)
|
||||
{
|
||||
sql = std::string("begin ")+DatabaseConnection::getInstance().getSchemaQualifier()+"login.upsert_account_map(:parentID, :childID); end;";
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool TaskMapAccount::MapAccountQuery::bindParameters()
|
||||
{
|
||||
if (!bindParameter(parentID)) return false;
|
||||
if (!bindParameter(childID)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool TaskMapAccount::MapAccountQuery::bindColumns()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
DB::Query::QueryMode TaskMapAccount::MapAccountQuery::getExecutionMode() const
|
||||
{
|
||||
return MODE_PROCEXEC;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
Reference in New Issue
Block a user