Hi,
Thanks for suggestion, but unfortunately I tried but it does
not seem to work for me :-( I am posting my code, so that
people can get a closer look. :-)
Page.pm
package DBI::Page;
use base 'DBI::Sec_scheduler';
__PACKAGE__->table('page');
__PACKAGE__->columns(All => (
"page_id",
"page_title",
)
);
__PACKAGE__->has_many(cols => 'DBI::Column');
1;
Page_column.pm
package DBI::Page_column;
use base 'DBI::Sec_scheduler';
__PACKAGE__->table('page_column');
__PACKAGE__->columns(All => (
"page_id",
"column_id",
)
);
__PACKAGE__->has_a(page_id => 'DBI::Page');
__PACKAGE__->has_a(column_id => 'DBI::Column');
1;
Column.pm
package DBI::Column;
use base 'DBI::Sec_scheduler';
__PACKAGE__->table('column');
__PACKAGE__->columns(All => (
"column_id",
"column_title",
)
);
__PACKAGE__->has_many(pages => 'DBI::Page');
1;
test.pl
#!/usr/bin/perl
use strict; use warnings;
use Data::Dumper;
use lib '/home/rohan/work/sec_scheduler/modules';
use sec_scheduler;
my $p = DBI::Page->retrieve(page_id => 1);
print Dumper($p->cols);
After I run test.pl, I get the foll. error:
Use of 'croak' is deprecated at /usr/lib/perl5/site_perl/5.8.0/Class/DBI.pm line 950. Use '_croak' instead
is not a column of DBI::Column at ./test.pl line 9
--
arc_of_descent