Hello,
try to remove
dbo::field(a, code, "code");
You should not call dbo::field with field, used as ID.
Regards,
Boris Nagaev
On Tue, Mar 25, 2014 at 9:36 PM, Jason H <[email protected]> wrote:
>
> This is my first experience using the Dbo module.
>
>
> I don't know why it is giving me an error. The schema is (code text primary
> key, state text, city text) (SQLite3)
>
>
>
> class PostalCode
>
> {
>
> public:
>
> std::string code;
>
> std::string state;
>
> std::string city;
>
>
> template<class Action>
>
> void persist(Action& a)
>
> {
>
> dbo::id (a, code, "code");
>
> dbo::field(a, code, "code");
>
> dbo::field(a, state, "state");
>
> dbo::field(a, city, "city");
>
> }
>
> };
>
>
> namespace Wt {
>
> namespace Dbo {
>
>
> template<>
>
> struct dbo_traits<PostalCode> : public dbo_default_traits {
>
> static const char *surrogateIdField() {
>
> return "code";
>
> }
>
> static const char *versionField() {
>
> return 0;
>
> }
>
> typedef std::string IdType;
>
>
> static IdType invalidId() {
>
> return std::string();
>
> }
>
> };
>
>
> }
>
> }
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest