Data documentation sample code outdated #620

This commit is contained in:
Alex Fabijanic 2014-11-24 19:37:16 -06:00
parent f848f0db19
commit ccf0e78b6a

View File

@ -963,14 +963,14 @@ The template specialization must implement the following methods:
class TypeHandler<class Person> class TypeHandler<class Person>
{ {
public: public:
static void bind(std::size_t pos, const Person&amp; obj, AbstractBinder::Ptr pBinder) static void bind(std::size_t pos, const Person&amp; obj, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
{ {
poco_assert_dbg (!pBinder.isNull()); poco_assert_dbg (!pBinder.isNull());
// the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3)) // the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3))
// Note that we advance pos by the number of columns the datatype uses! For string/int this is one. // Note that we advance pos by the number of columns the datatype uses! For string/int this is one.
TypeHandler<std::string>::bind(pos++, obj.getFirstName(), pBinder); TypeHandler<std::string>::bind(pos++, obj.getFirstName(), pBinder, dir);
TypeHandler<std::string>::bind(pos++, obj.getLastName(), pBinder); TypeHandler<std::string>::bind(pos++, obj.getLastName(), pBinder, dir);
TypeHandler<Poco::UInt64>::bind(pos++, obj.getSocialSecNr(), pBinder); TypeHandler<Poco::UInt64>::bind(pos++, obj.getSocialSecNr(), pBinder, dir);
} }
static std::size_t size() static std::size_t size()
@ -978,7 +978,7 @@ The template specialization must implement the following methods:
return 3; // we handle three columns of the Table! return 3; // we handle three columns of the Table!
} }
static void prepare(std::size_t pos, const Person&amp; obj, AbstractPreparation::Ptr pPrepare) static void prepare(std::size_t pos, const Person&amp; obj, AbstractPreparator::Ptr pPrepare)
{ {
poco_assert_dbg (!pPrepare.isNull()); poco_assert_dbg (!pPrepare.isNull());
// the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3)) // the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3))