Hallo,

I think I've 'managed' this now. ;)

Digging this mailing list again (and again...), I've found the hint to place a
function in the ::Manager that does what I need. So, I added a function to the
::Manager of my 'central table' that loads all the data from all related tables.
This way, I can drop in a different schema and provide reliable data by just
adding the appropriate method. The knot was cut. :)

My 'driver' now takes the data and converts it into a hash of hashes by
recursion. So, I can cleanly update related objects by using the
has_loaded_related() RDBO::Helper method. :)


Here's the manager method (for those who, like me, just need an idea...):

sub get_full_data_iterator {
    my ( $class, $id, $db ) = @_;
    my $with;
    
    foreach my $rel ( $class->object_class->meta->relationships ) {
        push @{$with}, $rel->name;
    }
    
    my %params = (
        query => [
            SYSTEMID  => $id,
        ],
        with_objects  => $with, 
        db            => $db,
        multi_many_ok => 1,
    );

    my $itr = $class->get_objects_iterator(
        %params
    );

    return $itr;
};



Thanks again.

Bianka


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to