Reinstate examples after botched merge
Peter Rabbitson [Fri, 27 Feb 2009 00:18:15 +0000 (00:18 +0000)]
examples/Schema/MyDatabase/Main.pm
examples/Schema/MyDatabase/Main/Result/Artist.pm [moved from examples/Schema/MyDatabase/Main/Artist.pm with 65% similarity]
examples/Schema/MyDatabase/Main/Result/Cd.pm [moved from examples/Schema/MyDatabase/Main/Cd.pm with 51% similarity]
examples/Schema/MyDatabase/Main/Result/Track.pm [moved from examples/Schema/MyDatabase/Main/Track.pm with 65% similarity]
examples/Schema/testdb.pl

index 6b9eef7..42fae1b 100644 (file)
@@ -1,5 +1,5 @@
 package MyDatabase::Main;
 use base qw/DBIx::Class::Schema/;
-__PACKAGE__->load_classes(qw/Artist Cd Track/);
+__PACKAGE__->load_namespaces;
 
 1;
similarity index 65%
rename from examples/Schema/MyDatabase/Main/Artist.pm
rename to examples/Schema/MyDatabase/Main/Result/Artist.pm
index 5f039e6..ec78501 100644 (file)
@@ -1,10 +1,10 @@
-package MyDatabase::Main::Artist;
+package MyDatabase::Main::Result::Artist;
 use base qw/DBIx::Class/;
 __PACKAGE__->load_components(qw/PK::Auto Core/);
 __PACKAGE__->table('artist');
 __PACKAGE__->add_columns(qw/ artistid name /);
 __PACKAGE__->set_primary_key('artistid');
-__PACKAGE__->has_many('cds' => 'MyDatabase::Main::Cd');
+__PACKAGE__->has_many('cds' => 'MyDatabase::Main::Result::Cd');
 
 1;
 
similarity index 51%
rename from examples/Schema/MyDatabase/Main/Cd.pm
rename to examples/Schema/MyDatabase/Main/Result/Cd.pm
index 4579823..83fd21e 100644 (file)
@@ -1,10 +1,10 @@
-package MyDatabase::Main::Cd;
+package MyDatabase::Main::Result::Cd;
 use base qw/DBIx::Class/;
 __PACKAGE__->load_components(qw/PK::Auto Core/);
 __PACKAGE__->table('cd');
 __PACKAGE__->add_columns(qw/ cdid artist title/);
 __PACKAGE__->set_primary_key('cdid');
-__PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Artist');
-__PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Track');
+__PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Result::Artist');
+__PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Result::Track');
 
 1;
similarity index 65%
rename from examples/Schema/MyDatabase/Main/Track.pm
rename to examples/Schema/MyDatabase/Main/Result/Track.pm
index 3710406..23877bb 100644 (file)
@@ -1,9 +1,9 @@
-package MyDatabase::Main::Track;
+package MyDatabase::Main::Result::Track;
 use base qw/DBIx::Class/;
 __PACKAGE__->load_components(qw/PK::Auto Core/);
 __PACKAGE__->table('track');
 __PACKAGE__->add_columns(qw/ trackid cd title/);
 __PACKAGE__->set_primary_key('trackid');
-__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Cd');
+__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Result::Cd');
 
 1;
index b31773d..9ca3e39 100644 (file)
@@ -26,7 +26,6 @@ sub get_tracks_by_cd {
         },
         {
             join     => [qw/ cd /],
-            prefetch => [qw/ cd /]
         }
     );
     while (my $track = $rs->next) {
@@ -79,7 +78,6 @@ sub get_cds_by_artist {
         },
         {
             join     => [qw/ artist /],
-            prefetch => [qw/ artist /]
         }
     );
     while (my $cd = $rs->next) {