----- Original Message -----
From: "Pugh, Eric" <[EMAIL PROTECTED]>
> Hi all,
>
> I looked through the archives to find the answer, b/c I swear I saw the
> answer, but no luck...
>
> I am using MSSQL as my database, and all my tables are set with
> idMethod=none, using Turbine 2.1.
>
> I want to copy a product object with product id 2.   So I do:
> productB = productA.copy();

Try adding this:

    productB.setNew(true);

> productB.save();
>
> This saves my new row in the database, but my productB's primary key is
> null.  I used profiler and see the we are doing an insert, but there
doesn't
> be anything like return @@Identity or anything to pass back what my new
> primary key is.
>
> Is the only way of figuring what productB's primary key is to do a select
> max(product_id) on my products table?
>
> Eric

HTH.

Scott



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to