mrh30 has asked for the wisdom of the Perl Monks concerning the following question:
A User can be either a Client or a Candidate:#!/usr/bin/perl package MyDB::Users; use base 'MyDB::DBI'; MyDB::Users->table('USERS'); MyDB::Users->columns( All => qw/USERNAME PASS USERTYPE EMAIL/); MyDB::Users->might_have( CANDIDATE => 'MyDB::Candidates' => qw/FIRSTNAME LASTNAME DISABLED +CV/); MyDB::Users->might_have( CLIENT => 'MyDB::Clients' => qw/NAME MAXROLES MAXCOMPETENCIES/); 1;
and#!/usr/bin/perl package MyDB::Candidates; use base 'MyDB::DBI'; use MyDB::Users; MyDB::Candidates->table('CANDIDATES'); MyDB::Candidates->columns( All => qw/USERNAME FIRSTNAME LASTNAME DISABLED/ ); MyDB::Candidates->is_a( USERNAME => 'MyDB::Users' ); 1;
Anyway... The problem comes when in the code for the app itself I call#!/usr/bin/perl package MyDB::Clients; use base 'MyDB::DBI'; use MyDB::Users; MyDB::Clients->table('CLIENTS'); MyDB::Clients->columns( All => qw/USERNAME NAME MAXROLES MAXCOMPETENCIES/); MyDB::Clients->is_a( USERNAME => 'MyDB::Users'); 1;
At which point I get the error:my @objs = MyDB::Clients->retrieve_all();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::DBI::Relationship::IsA problem
by Taulmarill (Deacon) on Jul 28, 2005 at 12:32 UTC | |
by mrh30 (Initiate) on Jul 28, 2005 at 13:59 UTC | |
by mrh30 (Initiate) on Jul 29, 2005 at 08:05 UTC |