Hi John,

John Siracusa wrote:
> On 8/30/06, Kurt Hansen <[EMAIL PROTECTED]> wrote:
>>>     my($sql, $bind) = $class->get_products_sql(%args);
>> Shouldn't this be:
>>
>>         my($sql, $bind) = $class->get_objects_sql(%args);
> 
> Whoops, yeah, and you'll have to pass an object_class => ... parameter
> in %args unless you've overridden object_class() (although there's a
> bug regarding that bit, fixed in SVN, but for now best to just add
> object_class => ... to %args)
> 
>> However, using this code gives me the following error:
>>
>> Can't call method "meta" on an undefined value at
>> /usr/local/lib/perl5/site_perl/5.8.5/Rose/DB/Object/Manager.pm line 325.
>>
>> line 325 is this:
>>
>>         my $meta = $object_class->meta;
>>
>> in the get_objects method.
> 
> Looks like you found that bug I just mentioned :)  Just add
> object_class => 'My::Product' (or whatever) to %args.

Thanks! Yes, I had figured that out and added

$args{'object_class'} = 'My::Product';

(sticking with your nomenclature) and moved on to the next bug...

Now, I'm having problems with the

$args{'select'} = "$args{'group_by'}, AVG(prices) ";

line. The sql that is being produced is:

SELECT t2.type, t1.AVG{prices) ....

so throws an error. The sql should be:

SELECT t2.type, AVG(t1.prices) ....

I've been looking through the docs trying to figure out how to properly 
specify AVG(COLUMN) in the 'select' argument with no success. Is it 
possible?

Take care,

Kurt



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to