Fixed Storage/DBI (tried to load deprecated ::Exception component)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ObjectCache.pm
index 7827a57..3dd8ec0 100644 (file)
@@ -3,7 +3,7 @@ package DBIx::Class::ObjectCache;
 use strict;
 use warnings;
 
-use base qw/Class::Data::Inheritable/;
+use base qw/DBIx::Class/;
 
 __PACKAGE__->mk_classdata('cache');
 
@@ -14,7 +14,7 @@ __PACKAGE__->mk_classdata('cache');
 =head1 SYNOPSIS
 
     # in your class definition
-    use Cache::FastMmmap;
+    use Cache::FastMmap;
     __PACKAGE__->cache(Cache::FastMmap->new);
 
 =head1 DESCRIPTION
@@ -33,20 +33,20 @@ implements the required C<get>, C<set>, and C<remove> methods.
 
 sub insert {
   my $self = shift;
-  $self->NEXT::ACTUAL::insert(@_);
+  $self->next::method(@_);
   $self->_insert_into_cache if $self->cache;  
   return $self;
 }
 
 sub find {
   my ($self,@vals) = @_;
-  return $self->NEXT::ACTUAL::find(@vals) unless $self->cache;
+  return $self->next::method(@vals) unless $self->cache;
   
   # this is a terrible hack here. I know it can be improved.
   # but, it's a start anyway. probably find in PK.pm needs to
   # call a hook, or some such thing. -Dave/ningu
   my ($object,$key);
-  my @pk = keys %{$self->_primaries};
+  my @pk = $self->primary_columns;
   if (ref $vals[0] eq 'HASH') {
     my $cond = $vals[0]->{'-and'};
     $key = $self->_create_ID(%{$cond->[0]}) if ref $cond eq 'ARRAY';
@@ -62,14 +62,14 @@ sub find {
     return $object;
   }
   
-  $object = $self->NEXT::ACTUAL::find(@vals);
+  $object = $self->next::method(@vals);
   $object->_insert_into_cache if $object;
   return $object;
 }
 
 sub update {
   my $self = shift;
-  my $new = $self->NEXT::ACTUAL::update(@_);
+  my $new = $self->next::method(@_);
   $self->_insert_into_cache if $self->cache;
   return;
 }
@@ -77,12 +77,12 @@ sub update {
 sub delete {
   my $self = shift;
   $self->cache->remove($self->ID) if $self->cache;
-  return $self->NEXT::ACTUAL::delete(@_);
+  return $self->next::method(@_);
 }
 
 sub _row_to_object {
   my $self = shift;
-  my $new = $self->NEXT::ACTUAL::_row_to_object(@_);
+  my $new = $self->next::method(@_);
   $new->_insert_into_cache if $self->cache;
   return $new;
 }
@@ -99,7 +99,7 @@ sub _insert_into_cache {
 
 =head1 AUTHORS
 
-David Kamholz <davekam@pobox.com>
+David Kamholz <dkamholz@cpan.org>
 
 =head1 LICENSE