Re: [CDBI] Turning Class::DBI on its side
Dave Howorth <dhoworth-fDajt2Yx3S8pY9vWkoisglpr/1R2p/[email protected]> Wed, 25 Jul 2007 15:11:54 +0100
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Organization | MRC Centre for Protein Engineering |
| Message-ID | <[email protected]> |
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