Hello,

while I'm doing my first steps into Rose::DB, I face the following problem:
I am looking for a way to maintain identity of Rose::DB::Object 
instances, that share the same PK. ( Represent the same row ).

I hoped deriving from Rose::DB::Object::Cached would achieve this, but 
it seems, that this is not true for Instances returned by the 
Rose::DB::Object::Manager derived Classes.
Is there a best practice how to handle this?

Regards, Christoph Lamprecht

use strict;
use warnings;

my @classes = qw/
                   Tko::Person   # ISA Rose::DB::Object::Cached
                 /;

for (@classes) {eval "require $_";
                 eval "require ${_}::Manager";
             };


my $p = Tko::Person->new(id => 3);
$p->load;
print 'name: ',$p->name,", self = [$p]\n";

my $instances = Tko::Person::Manager->get_objects();

for (@$instances){
     print 'name: ',$_->name,", self = [$_]\n";
}

undef $p;
$p = Tko::Person->new(id => 3);
$p->load;
print 'name: ',$p->name,", self = [$p]\n";



output:


name: Willi, self = [Tko::Person=HASH(0x8189fd4)]
name: Willi, self = [Tko::Person=HASH(0x8e748d8)]
name: Willi, self = [Tko::Person=HASH(0x8189fd4)]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to