more useful options | |
PerlMonks |
Re: Database Accessor Classesby nothingmuch (Priest) |
on Mar 09, 2006 at 08:34 UTC ( [id://535345]=note: print w/replies, xml ) | Need Help?? |
Most object relational mapper thingamabobs allow you to specify which fields are loaded in the begining, and which fields are lazily fetched.
The basic idea is that the user class is asked for an object with id $whatever, and then that class uses the ORM goodness to, at the very least, check if that id matches the primary key fields of the table it's mapping. In this query it will also fetch all the fields which it has been told to, and can even pre-fetch relationships (Class::DBI doesn't support this, but DBIx::Class does). Whenever you ask the object for not-yet-ready field it will make another SQL statement, and fetch that field as well.
-nuffin zz zZ Z Z #!perl
In Section
Seekers of Perl Wisdom
|
|