Re: Problems with set_sql and iterators

[prev] [thread] [next] [Date index for 2005/06/20]

From: William Ross
Subject: Re: Problems with set_sql and iterators
Date: 12:51 on 20 Jun 2005
On 20 Jun 2005, at 12:44, Jacinta Richardson wrote:

> <snip>
> Since CDBI *can* be used to perform aggregate searches on the  
> tables the classes are defined for, and since aggregate searches  
> can't keep the primary key information intact, it seems to me that  
> this overload to bool which marks the objects as false is strange.   
> There is obviously data there, I wish to use it, why say the object  
> is false?

The short answer is that to work with cdbi without getting messy,  
your design needs to be such that your aggregate searches *do* return  
inflatable objects. In my experience, if that is proving awkward   
then the query is either being issued from the wrong class, or the  
database is insufficiently normalised, or both.

It's hard to be more specific: your simplification of the problem is  
helpful but makes it difficult (for me) to understand what an  
'allocation' represents. if - guess - it's something like an  
allocation of time by that person, then the summary report ought to  
be easy to generate with eg:

     sub total_allocation {
         my $self = shift;
         return Staff::Project::Allocation->sum_where( project =>  
$self );
     }

so my suspicion is that you have a summary column where you need to  
have a many-to-many table.

but I'm no DBA :)


will



(message missing)

Problems with set_sql and iterators
Jacinta Richardson 07:50 on 20 Jun 2005

Re: Problems with set_sql and iterators
Tony Bowden 08:29 on 20 Jun 2005

Re: Problems with set_sql and iterators
Jacinta Richardson 09:01 on 20 Jun 2005

Re: Problems with set_sql and iterators
merlyn (Randal L. Schwartz) 10:13 on 20 Jun 2005

Re: Problems with set_sql and iterators
Jacinta Richardson 11:44 on 20 Jun 2005

Re: Problems with set_sql and iterators
William Ross 12:51 on 20 Jun 2005

Re: Problems with set_sql and iterators
Michael Peters 13:30 on 20 Jun 2005

Re: Problems with set_sql and iterators
Jacinta Richardson 00:37 on 21 Jun 2005

Re: Problems with set_sql and iterators
Tony Bowden 13:57 on 20 Jun 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52