5 |
package Tangram::AbstractHash; |
package Tangram::AbstractHash; |
6 |
|
|
7 |
use Tangram::Coll; |
use Tangram::Coll; |
8 |
use base qw( Tangram::Coll ); |
use vars qw(@ISA); |
9 |
|
@ISA = qw( Tangram::Coll ); |
10 |
|
|
11 |
use Carp; |
use Carp; |
12 |
|
|
21 |
my ($self, $def, $storage, $obj, $member, $class) = @_; |
my ($self, $def, $storage, $obj, $member, $class) = @_; |
22 |
|
|
23 |
print $Tangram::TRACE "loading $member\n" if $Tangram::TRACE; |
print $Tangram::TRACE "loading $member\n" if $Tangram::TRACE; |
24 |
|
|
25 |
my %coll; |
my %coll; |
26 |
|
|
27 |
if (my $prefetch = $storage->{PREFETCH}{$class}{$member}{$storage->id($obj)}) |
if (my $prefetch = $storage->{PREFETCH}{$class}{$member}{$storage->id($obj)}) |
31 |
else |
else |
32 |
{ |
{ |
33 |
my $cursor = $self->cursor($def, $storage, $obj, $member); |
my $cursor = $self->cursor($def, $storage, $obj, $member); |
34 |
|
|
35 |
for (my $item = $cursor->select; $item; $item = $cursor->next) |
for (my $item = $cursor->select; $item; $item = $cursor->next) |
36 |
{ |
{ |
37 |
my $slot = shift @{ $cursor->{-residue} }; |
my $slot = shift @{ $cursor->{-residue} }; |
39 |
} |
} |
40 |
} |
} |
41 |
|
|
42 |
$self->set_load_state($storage, $obj, $member, map { $_ => ($coll{$_} && $storage->id( $coll{$_} ) ) } keys %coll ); |
$self->set_load_state($storage, $obj, $member, { map { $_ => ($coll{$_} && $storage->id( $coll{$_} ) ) } keys %coll } ); |
43 |
|
|
44 |
return \%coll; |
return \%coll; |
45 |
} |
} |