Hi,

Thanks for response,


> 
> 1. why invalidId returns UUID::generate()?
>

I'm using uuid as id for Client table so when error I want my default id
is uuid.

2. Client has no fields "note" and "name".


Sorry for that, I was trying to abstract my problem so I missed to add
those fields to my last email.

When I extracted my dbo classes to a clean project in order to post them
here, I found they work with no problem. So until now I don't know where
the problem is.
Is there any way to view the generated queries with its parameters not the
way setProperty("show-queries", "true") do.


On Tue, Jan 7, 2014 at 4:06 PM, Nagaev Boris <[email protected]> wrote:

> Hello,
>
> 
> 1. why invalidId returns UUID::generate()?
> 2. Client has no fields "note" and "name".
>
> Could you provide complete example as .cpp file?
>
> Regards,
> Boris Nagaev
>
>
> On Tue, Jan 7, 2014 at 11:13 AM, Muhammad Nasser Al-Noimi
> <[email protected]> wrote:
> > Hi,
> >
> > I'm trying to update a record using modify() for table with altered
> primary
> > key, But the commit fails and exit with error: "constraint failed". When
> I
> > checked the query generated I noticed that the primary key is in the
> fields
> > list.
> >
> > The following code demonstrate the problem:
> >
> > //Definitions
> > typedef long long DbId;
> > namespace Wt {
> >     namespace Dbo {
> >     template<>
> >     struct dbo_traits<Client> : public dbo_default_traits {
> >         static DbId invalidId() { return UUID::generate(); }
> >         static const char *surrogateIdField() { return 0; }
> >     };
> >     }
> > class Client {
> > public:
> >     DbId id;
> >     template<class Action>
> >     void persist(Action& a)
> >     {
> >         dbo::id(a, id, "id");
> >     }
> > };
> >
> > // This is how I search for record to be modified:
> > clientPtr = session()->find<Client>().where("name = ?").bind("name");
> > // Every thing is ok until now, I can obtain the data and there is a
> result
> > of this query
> >
> > //The error pops when I call the following:
> > clientPtr.modify()->note = "note";
> >
> > Thanks alot,
> > Nasser Al-Noimi
> >
> >
> ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business. Most IT
> > organizations don't have a clear picture of how application performance
> > affects their revenue. With AppDynamics, you get 100% visibility into
> your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> > Pro!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> > _______________________________________________
> > witty-interest mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/witty-interest
> >
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to