in reply to Re: Search for ORM with Multi-Table-Object Support
in thread Search for ORM with Multi-Table-Object Support
Thanks for your answer,
I am not sure if you mean the same as I do, when refering to Multi-Table-Mapping-Objects.
I mean an object, which consists of one row out of one table and another one out of another table.
What I would wish to do is
# Tablesetup: [user] id username password [user_contact] id firstname lastname street zip city phone [user_profile] id profile_text profile_image # Code-Example $user->load({id => 1, fetch => qw('username firstname lastname')}); print $user->firstname; # prints prefetched firstname print $user->lastname; # prints prefetched lastname print $user->profile_text; # prints lazy-loaded profile_text
As I understand DBIC I would do the following (ignoring lazy-loading):
$user = $schema->resultset('User')->find(1); print $user->user_contact->firstname; print $user->user_contact->lastname; print $user->user_profile->profile_text;
Well, of course I could get around this limitation by writing my own setters and getters accessing the sub-objects from within the parent-object. Maybe this is the best way to do it, but I tought there may be ORMs which can handle this behavior already.
Regards
Alex
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Search for ORM with Multi-Table-Object Support
by Your Mother (Archbishop) on May 03, 2012 at 00:52 UTC | |
Re^3: Search for ORM with Multi-Table-Object Support
by preaction (Beadle) on May 02, 2012 at 22:46 UTC | |
by Xel (Novice) on May 03, 2012 at 07:10 UTC | |
Re^3: Search for ORM with Multi-Table-Object Support
by trwww (Priest) on May 03, 2012 at 04:56 UTC |
In Section
Seekers of Perl Wisdom