Re: quick retrieval help

[prev] [thread] [next] [Date index for 2005/01/14]

From: Peter Speltz
Subject: Re: quick retrieval help
Date: 08:06 on 14 Jan 2005

> >  
> >
> Most probably you're talking about:
> 
> my @interfaces = map NAC::Interface->construct($_), 
> $sth_int_down->fetchall_hash;
> foreach (@interfaces) {
>     print $_->id
> }
> 

I have never understood this construct method and have been wanting too for a
while. Can someone tell me if this is a accurate undertanding?

construct takes a hash and turns it into an object. You execute a sql statement
to retrieve the data efficiently-- joins and all that -- so that several
queries are not executed to create the objects as happens typically when an
object has_a and has_many things. So something like the above example can be
much faster than a simple retrieve_all. 

Is that on target?

thanks.

=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

quick retrieval help
Hartmaier Alexander 15:27 on 13 Jan 2005

Re: quick retrieval help
Aleksandr Guidrevitch 18:47 on 13 Jan 2005

Re: quick retrieval help
Hartmaier Alexander 07:23 on 14 Jan 2005

Re: quick retrieval help
Aleksandr Guidrevitch 07:51 on 14 Jan 2005

Re: quick retrieval help
Peter Speltz 08:06 on 14 Jan 2005

Re: quick retrieval help
Tony Bowden 10:06 on 14 Jan 2005

Re: quick retrieval help
Peter Speltz 17:04 on 14 Jan 2005

Re: quick retrieval help
Aleksandr Guidrevitch 14:44 on 14 Jan 2005

Re: quick retrieval help
Hartmaier Alexander 15:25 on 14 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52