[CDBI] Turning Class::DBI on its side

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Wed Jul 25 15:11:54 BST 2007

Duncan Ferguson wrote:
> So, how I can set up the accessors to point to a row in the database
> rather than a column?  There should only be one row per name (so name
> could be a primary key rather than id).  I can see that I probably have
> to provide/create each accessor for each distinct item in the table (or
> do a generic AUTOLOAD one to search for the item and get the value) but
> how do I create the correct object to be returned to the caller? 

Well if you really want to do that :) ...

If the body of your accessor methods use code similar to that you
already showed, the objects will already be constructed (by the search)
will they not?

Cheers, Dave

More information about the ClassDBI mailing list