5 #include <Poco/Data/TypeHandler.h>
6 #include <Poco/Data/AbstractExtractor.h>
7 #include <Poco/Data/AbstractBinder.h>
8 #include <Poco/Data/AbstractPreparation.h>
10 using namespace Poco::Data;
17 Person(
int Id,
const std::string& Name):id(Id),name(Name){}
20 return name == other.
name;
23 bool operator < (
const Person& p)
const {
24 if (this->name < p.
name)
37 static void bind(std::size_t pos,
const Person& obj, Poco::Data::AbstractBinder* pBinder)
40 poco_assert_dbg (pBinder != 0);
41 pBinder->bind(pos++, obj.
id);
42 pBinder->bind(pos++, obj.
name);
45 static void prepare(std::size_t pos,
const Person& obj, Poco::Data::AbstractPreparation* pPrepare)
48 poco_assert_dbg (pPrepare != 0);
49 pPrepare->prepare(pos++, obj.
id);
50 pPrepare->prepare(pos++, obj.
name);
53 static std::size_t size()
58 static void extract(std::size_t pos,
Person& obj,
const Person& defVal, Poco::Data::AbstractExtractor* pExt)
60 poco_assert_dbg (pExt != 0);
61 if (!pExt->extract(pos++, obj.
id))
63 if (!pExt->extract(pos++, obj.
name))
70 TypeHandler(
const TypeHandler&);
71 TypeHandler& operator=(
const TypeHandler&);