#include <typeinfo>
#include <utility>
#include <set>
+#include <list>
#include <memory>
+#include <boost/optional.hpp>
+#include <dpl/log/wrt_log.h>
#include <dpl/db/sql_connection.h>
#include <dpl/db/orm_interface.h>
#include <dpl/string.h>
-#include <dpl/optional.h>
#include <dpl/type_list.h>
#include <dpl/assert.h>
#include <dpl/foreach.h>
typedef size_t ColumnIndex;
typedef size_t ArgumentIndex;
-typedef DPL::Optional<DPL::String> OptionalString;
-typedef DPL::Optional<int> OptionalInteger;
+typedef boost::optional<DPL::String> OptionalString;
+typedef boost::optional<int> OptionalInteger;
typedef DPL::DB::SqlConnection::DataCommand DataCommand;
namespace RelationTypes {
{
CustomRowUtil<ColumnList>::CopyColumnList(r.m_columns, m_columns);
}
+ CustomRow& operator=(const CustomRow& r)
+ {
+ if(this == &r) return *this;
+ CustomRowUtil<ColumnList>::CopyColumnList(r.m_columns, m_columns);
+ return *this;
+ }
virtual ~CustomRow()
{
this->m_command = TableDefinition::AllocTableDataCommand(
this->m_commandString.c_str(),
Query<TableDefinition>::m_interface);
- LogPedantic("Prepared SQL command " << this->m_commandString);
+ //WrtLogD("Prepared SQL command %s", this->m_commandString.c_str());
}
}
typedef DPL::DB::SqlConnection::RowID RowID;
protected:
- DPL::Optional<std::string> m_orClause;
+ boost::optional<std::string> m_orClause;
Row m_row;
class PrepareVisitor {
this->m_commandString += " ( " + visitor.m_columnNames + " ) ";
this->m_commandString += "VALUES ( " + visitor.m_values + " )";
- LogPedantic("Prepared SQL command " << this->m_commandString);
+ //WrtLogD("Prepared SQL command %s", this->m_commandString.c_str());
this->m_command = TableDefinition::AllocTableDataCommand(
this->m_commandString.c_str(),
Query<TableDefinition>::m_interface);
public:
explicit Insert(
IOrmInterface* interface = NULL,
- const DPL::Optional<std::string>& orClause = DPL::Optional<std::string>::Null) :
+ const boost::optional<std::string>& orClause = boost::optional<std::string>()) :
Query<TableDefinition>(interface),
m_orClause(orClause)
{
typedef std::list<Row> RowList;
protected:
- DPL::Optional<std::string> m_orderBy;
+ boost::optional<std::string> m_orderBy;
std::string m_JoinClause;
bool m_distinctResults;
QueryWithWhereClause<TableDefinition>::Prepare();
- if ( !m_orderBy.IsNull() )
+ if ( !!m_orderBy )
{
this->m_commandString += " ORDER BY " + *m_orderBy;
}
this->m_commandString.c_str(),
Query<TableDefinition>::m_interface);
- LogPedantic("Prepared SQL command " << this->m_commandString);
+ //WrtLogD("Prepared SQL command %s", this->m_commandString.c_str());
}
}
typedef typename TableDefinition::Row Row;
protected:
- DPL::Optional<std::string> m_orClause;
+ boost::optional<std::string> m_orClause;
Row m_row;
class PrepareVisitor {
this->m_command = TableDefinition::AllocTableDataCommand(
this->m_commandString.c_str(),
Query<TableDefinition>::m_interface);
- LogPedantic("Prepared SQL command " << this->m_commandString);
+ //WrtLogD("Prepared SQL command %s", this->m_commandString.c_str());
}
}
public:
explicit Update(IOrmInterface *interface = NULL,
- const DPL::Optional<std::string>& orClause = DPL::Optional<std::string>::Null) :
+ const boost::optional<std::string>& orClause = boost::optional<std::string>()) :
QueryWithWhereClause<TableDefinition>(interface),
m_orClause(orClause)
{