r31542 - in /trunk/librose-db-object-perl: ./ debian/ lib/Rose/DB/ lib/Rose/DB/Object/MakeMethods/ lib/Rose/DB/Object/Metadata/ lib/Rose/DB/Object/Metadata/Relationship/ t/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Mar 6 13:39:00 UTC 2009


Author: gregoa
Date: Fri Mar  6 13:38:57 2009
New Revision: 31542

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31542
Log:
New upstream release.

Modified:
    trunk/librose-db-object-perl/Changes
    trunk/librose-db-object-perl/META.yml
    trunk/librose-db-object-perl/debian/changelog
    trunk/librose-db-object-perl/lib/Rose/DB/Object.pm
    trunk/librose-db-object-perl/lib/Rose/DB/Object/MakeMethods/Generic.pm
    trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship.pm
    trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship/ManyToOne.pm
    trunk/librose-db-object-perl/t/db-object-relationship.t

Modified: trunk/librose-db-object-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/Changes?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/Changes (original)
+++ trunk/librose-db-object-perl/Changes Fri Mar  6 13:38:57 2009
@@ -1,3 +1,10 @@
+0.780 (03.04.2009) - John Siracusa <siracusa at gmail.com>
+
+    * Fixed a bug that caused the delete_relationships() Metadata method
+      to fail in some circumstances.  (Reported by vti)
+    * Fixed a few accessor/mutator mismatches in relationship methods.
+      (Reported by Bharanee)
+
 0.779 (02.26.2009) - John Siracusa <siracusa at gmail.com>
 
     * Added missing documentation on one-to-many and many-to-many 

Modified: trunk/librose-db-object-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/META.yml?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/META.yml (original)
+++ trunk/librose-db-object-perl/META.yml Fri Mar  6 13:38:57 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Rose-DB-Object
-version:            0.779
+version:            0.780
 abstract:           Extensible, high performance object-relational mapper (ORM).
 author:
     - John Siracusa <siracusa at gmail.com>

Modified: trunk/librose-db-object-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/debian/changelog?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/debian/changelog (original)
+++ trunk/librose-db-object-perl/debian/changelog Fri Mar  6 13:38:57 2009
@@ -1,3 +1,9 @@
+librose-db-object-perl (1:0.780-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Fri, 06 Mar 2009 14:38:12 +0100
+
 librose-db-object-perl (1:0.779-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/librose-db-object-perl/lib/Rose/DB/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/lib/Rose/DB/Object.pm?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/lib/Rose/DB/Object.pm (original)
+++ trunk/librose-db-object-perl/lib/Rose/DB/Object.pm Fri Mar  6 13:38:57 2009
@@ -16,7 +16,7 @@
 use Rose::DB::Object::Exception;
 use Rose::DB::Object::Util();
 
-our $VERSION = '0.779';
+our $VERSION = '0.780';
 
 our $Debug = 0;
 

Modified: trunk/librose-db-object-perl/lib/Rose/DB/Object/MakeMethods/Generic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/lib/Rose/DB/Object/MakeMethods/Generic.pm?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/lib/Rose/DB/Object/MakeMethods/Generic.pm (original)
+++ trunk/librose-db-object-perl/lib/Rose/DB/Object/MakeMethods/Generic.pm Fri Mar  6 13:38:57 2009
@@ -20,7 +20,7 @@
 use Rose::DB::Object::Helpers();
 use Rose::DB::Object::Util qw(column_value_formatted_key);
 
-our $VERSION = '0.779';
+our $VERSION = '0.780';
 
 our $Debug = 0;
 
@@ -3270,10 +3270,11 @@
 
         while(my($local_column, $foreign_column) = each(%$ft_columns))
         {
-          my $local_method   = $meta->column_accessor_method_name($local_column);
-          my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
-
-          $key{$foreign_column} = $map{$foreign_method} = $self->$local_method();
+          my $local_method     = $meta->column_accessor_method_name($local_column);
+          my $foreign_accessor = $ft_meta->column_accessor_method_name($foreign_column);
+          my $foreign_mutator  = $ft_meta->column_mutator_method_name($foreign_column);
+
+          $key{$foreign_column} = $map{$foreign_mutator} = $self->$local_method();
 
           # Comment this out to allow null keys
           unless(defined $key{$foreign_column})
@@ -3523,7 +3524,7 @@
         while(my($local_column, $foreign_column) = each(%$ft_columns))
         {
           my $local_method   = $meta->column_accessor_method_name($local_column);
-          my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
+          my $foreign_method = $ft_meta->column_mutator_method_name($foreign_column);
 
           $map{$foreign_method} = $self->$local_method();
         }
@@ -3549,10 +3550,11 @@
 
           while(my($local_column, $foreign_column) = each(%$ft_columns))
           {
-            my $local_method   = $meta->column_accessor_method_name($local_column);
-            my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
-
-            $key{$foreign_column} = $map{$foreign_method} = $self->$local_method();
+            my $local_method     = $meta->column_accessor_method_name($local_column);
+            my $foreign_accessor = $ft_meta->column_accessor_method_name($foreign_column);
+            my $foreign_mutator  = $ft_meta->column_mutator_method_name($foreign_column);
+
+            $key{$foreign_column} = $map{$foreign_mutator} = $self->$local_method();
 
             # Comment this out to allow null keys
             unless(defined $key{$foreign_column})
@@ -3753,10 +3755,11 @@
 
       while(my($local_column, $foreign_column) = each(%$ft_columns))
       {
-        my $local_method   = $meta->column_accessor_method_name($local_column);
-        my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
-
-        $key{$foreign_column} = $map{$foreign_method} = $self->$local_method();
+        my $local_method     = $meta->column_accessor_method_name($local_column);
+        my $foreign_accessor = $ft_meta->column_accessor_method_name($foreign_column);
+        my $foreign_mutator  = $ft_meta->column_mutator_method_name($foreign_column);
+
+        $key{$foreign_column} = $map{$foreign_mutator} = $self->$local_method();
 
         # Comment this out to allow null keys
         unless(defined $key{$foreign_column})
@@ -3850,10 +3853,11 @@
 
         while(my($local_column, $foreign_column) = each(%$ft_columns))
         {
-          my $local_method   = $meta->column_accessor_method_name($local_column);
-          my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
-
-          $key{$foreign_column} = $map{$foreign_method} = $self->$local_method();
+          my $local_method     = $meta->column_accessor_method_name($local_column);
+          my $foreign_accessor = $ft_meta->column_accessor_method_name($foreign_column);
+          my $foreign_mutator  = $ft_meta->column_mutator_method_name($foreign_column);
+
+          $key{$foreign_column} = $map{$foreign_mutator} = $self->$local_method();
 
           # Comment this out to allow null keys
           unless(defined $key{$foreign_column})
@@ -3929,7 +3933,7 @@
       while(my($local_column, $foreign_column) = each(%$ft_columns))
       {
         my $local_method   = $meta->column_accessor_method_name($local_column);
-        my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
+        my $foreign_method = $ft_meta->column_mutator_method_name($foreign_column);
 
         $map{$foreign_method} = $self->$local_method();
 
@@ -4039,7 +4043,7 @@
         while(my($local_column, $foreign_column) = each(%$ft_columns))
         {
           my $local_method   = $meta->column_accessor_method_name($local_column);
-          my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
+          my $foreign_method = $ft_meta->column_mutator_method_name($foreign_column);
 
           $map{$foreign_method} = $self->$local_method();
         }
@@ -4067,7 +4071,7 @@
         while(my($local_column, $foreign_column) = each(%$ft_columns))
         {
           my $local_method   = $meta->column_accessor_method_name($local_column);
-          my $foreign_method = $ft_meta->column_accessor_method_name($foreign_column);
+          my $foreign_method = $ft_meta->column_mutator_method_name($foreign_column);
 
           $map{$foreign_method} = $self->$local_method();
 

Modified: trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship.pm?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship.pm (original)
+++ trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship.pm Fri Mar  6 13:38:57 2009
@@ -9,7 +9,7 @@
 use Rose::DB::Object::Metadata::MethodMaker;
 our @ISA = qw(Rose::DB::Object::Metadata::MethodMaker);
 
-our $VERSION = '0.771';
+our $VERSION = '0.780';
 
 __PACKAGE__->add_common_method_maker_argument_names
 (
@@ -21,6 +21,7 @@
   { preserve_existing => 1 },
   scalar => 
   [
+    'foreign_key',
     'deferred_make_method_args',
     id => { interface => 'get_set_init' },
     __PACKAGE__->common_method_maker_argument_names,

Modified: trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship/ManyToOne.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship/ManyToOne.pm?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship/ManyToOne.pm (original)
+++ trunk/librose-db-object-perl/lib/Rose/DB/Object/Metadata/Relationship/ManyToOne.pm Fri Mar  6 13:38:57 2009
@@ -11,7 +11,7 @@
 use Rose::Object::MakeMethods::Generic;
 use Rose::DB::Object::MakeMethods::Generic;
 
-our $VERSION = '0.771';
+our $VERSION = '0.780';
 
 __PACKAGE__->default_auto_method_types(qw(get_set_on_save delete_on_save));
 
@@ -43,7 +43,6 @@
   { preserve_existing => 1 },
   scalar => 
   [
-    'foreign_key',
     __PACKAGE__->common_method_maker_argument_names
   ],
 );

Modified: trunk/librose-db-object-perl/t/db-object-relationship.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-db-object-perl/t/db-object-relationship.t?rev=31542&op=diff
==============================================================================
--- trunk/librose-db-object-perl/t/db-object-relationship.t (original)
+++ trunk/librose-db-object-perl/t/db-object-relationship.t Fri Mar  6 13:38:57 2009
@@ -7674,8 +7674,8 @@
         #column_map => { id => 'pid' },
         query_args => [ id => { ne_sql => 'pid' } ],
       },
-    );
-
+    );    
+    
     MySQLiteObject->meta->alias_column(fk1 => 'fkone');
 
     MySQLiteObject->meta->add_relationship
@@ -7715,6 +7715,130 @@
       },
     );
 
+    # Test to confirm a 0.780 fix for a bug in delete_relationships()
+    MySQLiteObject->meta->delete_relationships;
+
+    MySQLiteObject->meta->add_relationships
+    (
+      other_obj_osoft =>
+      {
+        type => 'one to one',
+        class => 'MySQLiteOtherObject',
+        column_map =>
+        {
+          fk1 => 'k1',
+          fk2 => 'k2',
+          fk3 => 'k3',
+        },
+        soft => 1,
+      },
+
+      other_obj_msoft =>
+      {
+        type => 'many to one',
+        class => 'MySQLiteOtherObject',
+        column_map =>
+        {
+          fk1 => 'k1',
+          fk2 => 'k2',
+          fk3 => 'k3',
+        },
+        referential_integrity => 0,
+        with_column_triggers => 1,
+      },
+
+      other2_objs =>
+      {
+        type  => 'one to many',
+        class => 'MySQLiteOtherObject2',
+        column_map => { id => 'pid' },
+        manager_args => { sort_by => 'rose_db_object_other2.name DESC' },
+        methods =>
+        {
+          find            => undef,
+          iterator        => undef,
+          get_set         => undef,
+          get_set_now     => 'other2_objs_now',
+          get_set_on_save => 'other2_objs_on_save',
+          add_now         => 'add_other2_objs_now',
+          add_on_save     => undef,
+        },
+      },
+
+      other2_a_objs =>
+      {
+        type  => 'one to many',
+        class => 'MySQLiteOtherObject2',
+        column_map => { id => 'pid' },
+        query_args => [ name => { like => 'a%' } ],
+        manager_args => { sort_by => 'name' },
+      },
+
+      other2_one_obj =>
+      {
+        type  => 'one to one',
+        class => 'MySQLiteOtherObject2',
+        column_map => { id => 'pid' },
+        query_args => [ name => 'one' ],
+        with_column_triggers => 1,
+      },
+
+      other2_objs2 =>
+      {
+        type  => 'one to many',
+        class => 'MySQLiteOtherObject2',
+        column_map => { id => 'pid' },
+      },
+
+      # Hrm.  Experimental...
+      not_other2_objs =>
+      {
+        type  => 'one to many',
+        class => 'MySQLiteOtherObject2',
+        #column_map => { id => 'pid' },
+        query_args => [ id => { ne_sql => 'pid' } ],
+      },
+    );    
+    
+    MySQLiteObject->meta->alias_column(fk1 => 'fkone');
+
+    MySQLiteObject->meta->add_relationship
+    (
+      colors =>
+      {
+        type      => 'many to many',
+        map_class => 'MySQLiteColorMap',
+        #map_from  => 'object',
+        #map_to    => 'color',
+        manager_args => { sort_by => 'name' },
+        methods =>
+        {
+          get_set         => undef,
+          get_set_now     => 'colors_now',
+          get_set_on_save => 'colors_on_save',
+          add_now         => undef,
+          add_on_save     => 'add_colors_on_save',
+          find            => undef,
+          count           => undef,
+          iterator        => undef,
+        },
+      },
+
+      colors2 =>
+      {
+        type      => 'many to many',
+        map_class => 'MySQLiteColorMap',
+        manager_args => { sort_by => 'name', with_map_records => 1 },
+      },
+
+      colors3 =>
+      {
+        type      => 'many to many',
+        map_class => 'MySQLiteColorMap',
+        manager_args => { sort_by => 'rose_db_object_colors_map.color_id DESC', with_map_records => 'map_rec' },
+      },
+    );
+
     eval { MySQLiteObject->meta->initialize };
     Test::More::ok($@, 'meta->initialize() reserved method - sqlite');
 




More information about the Pkg-perl-cvs-commits mailing list