[CDBI] problem with no primary key?

Tilman Baumann tilman.baumann at collax.com
Fri Nov 25 19:18:56 GMT 2005

Matt S Trout schrieb:

>On Fri, Nov 25, 2005 at 08:00:23PM +0100, Tilman Baumann wrote:
>>package LicServ::Option;
>>use base 'LicServ::DBI';
>>LicServ::Option->columns(Key => qw(name product_id value));
>>LicServ::Option->has_a(product_id => 'LicServ::Product');
>You haven't defined the Essential column group to tell Class::DBI which
>columns to select when it retrieves an object.
>Defining All implicitly defines Essential, if not already defined. 
>Also note that you *must* have a primary key. If you think you don't have one,
>the primary key is effectively all columns - i.e.
Yea. right. I thought i allready tried to set all as primary. It did'nt
work. Now i think it was a PEBACK :)

>LicServ::Option->columns(All => qw(name product_id value));
>LicServ::Option->columns(Primary => qw(name product_id value));

Perfect. This was it. I Tried only Primary but this didn't work. Giving
Both is perfect.
I see i wrote ->columns(Key => ... Maybe that's the problem. I think i
was confusing Key and Primary. (How do i come to Key?... %-) )

Perfect quick answer. I'm verry impressed. And of course pleased. ;)


Tilman Baumann
Software Developer
Collax GmbH . Boetzinger Straße 60 . 79111 Freiburg . Germany

p: +49 (0) 761-4514-836
f: +49 (0) 761-4563-793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20051125/b66d9411/attachment.htm

More information about the ClassDBI mailing list