Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)

[prev] [thread] [next] [Date index for 2005/05/24]

From: Tony Bowden
Subject: Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
Date: 13:26 on 24 May 2005
On Tue, May 24, 2005 at 09:07:27AM -0400, Christopher Laco wrote:
> In the original thred, I thought it was said that while construct()
> created the objects from data, CDBI still expected the data to already
> be in the database (aka it would update the record, not insert the
> record after any changes).

That's correct.

> In the example above, is there no record in the db backing that
> construct() call, 

Also correct.

> and does copy() make a completely new record in the database?

Yes. That's what copy() does. It takes one record and copies its data
into another one, creating it in the database.

The fact that the first record doesn't really exist doesn't really
matter here.

The only thing that's likely to be a problem is what happens to that
first record. I'm assuming that nothing breaks currently when that
object disappears, but that' sthe sort of thing that might change later,
which is why it would be a good idea to have an explicit test in the
baseline for this so that if anything does break it later we'll know.

Tony

Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
Tony Bowden 13:26 on 24 May 2005

Generated at 15:51 on 25 May 2005 by mariachi v0.52