[CDBI] What is the best way to search for record of table based on criteria of a field of its child table?

Sai Tong stong at fidelio.rutgers.edu
Fri Jan 6 18:11:01 GMT 2006


Given two tables:

table A --  Music::Artist
 tha  has a one-to-many relationship with
table B --   Music::CD  with the following setup:

Music::Artist->has_many(cds => 'Music::CD');
Music::CD->columns(All => qw/cdid artist title year reldate/);
Music::CD->has_a(artist => 'Music::Artist');

Is it possible to do the following with Class:DBI  

Music::Artist -> search( Music::Artist->cds->year => 1990 )

?

What is the best way to search for records of table A based on criteria 
of a field of its child table like table B?







More information about the ClassDBI mailing list