package State;
use base 'DBIx::Class';
+State->load_components(qw/CDBICompat Core/);
State->table('State');
State->columns(Essential => qw/Abbreviation Name/);
package City;
use base 'DBIx::Class';
+City->load_components(qw/CDBICompat Core/);
City->table('City');
City->columns(All => qw/Name State Population/);
#-------------------------------------------------------------------------
package CD;
use base 'DBIx::Class';
+CD->load_components(qw/CDBICompat Core/);
CD->table('CD');
CD->columns('All' => qw/artist title length/);
}
{
+ package DieTest;
+ @DieTest::ISA = qw(DBIx::Class);
+ DieTest->load_components(qw/Core/);
+ package main;
local $SIG{__WARN__} = sub { };
- eval { DBIx::Class->retrieve(1) };
+ eval { DieTest->retrieve(1) };
like $@, qr/Can't retrieve unless primary columns are defined/, "Need primary key for retrieve";
}
package A;
@A::ISA = qw(DBIx::Class);
+__PACKAGE__->load_components(qw/CDBICompat Core/);
__PACKAGE__->columns(Primary => 'id');
package A::B;