Re: [RDBO] Manager queries with secondary table and or
On Jan 10, 2008 1:36 PM, James Masters [EMAIL PROTECTED] wrote: I believe that I have a $spec{require_objects} = ['destaddress', ...] and this is working otherwise push @query, ('destaddress.primecontact' = {like = '%smith%'}); wouldn't work. [...] Anyway, your email implies that it should work so I'll have a look with the debug option on... Yeah, I actually tested it locally with one of my own classes bfore I made my earlier reply and got the same error, but then realized I'd neglected to put the relationship name in the with_objects or require_objects lists. When I did that, it worked fine for me. -John - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object
Re: [RDBO] Manager queries with secondary table and or
I don't think I'm going mad (but am usually proved wrong). Here is a test routine: sub gdb_get_orders_test { my $testspec1 = {require_objects = 'destaddress', query = ['destaddress.primecontact' = {like = '%smith%'}]}; my ($mysqlorders1, $mysqlerr1) = rose_get_orders($testspec1); print Found [EMAIL PROTECTED]Br; my $testspec2 = {require_objects = 'destaddress', query = ['or' = ['destaddress.primecontact' = {like = '%smith%'}]]}; my ($mysqlorders2, $mysqlerr2) = rose_get_orders($testspec2); print I never reach this line; } The output is: Found 16 Software error: Invalid query parameter: destaddress.primecontact at oprosemgord.pl line 983 at C:/Perl/site/lib/Rose/DB/Object/QueryBuilder.pm line 132 Rose::DB::Object::QueryBuilder::build_select('dbh', 'DBI::db=HASH(0x39b36d8)', 'tables', 'ARRAY(0x187fd54)', 'tables_sql', 'ARRAY(0x187fd90)', 'columns', 'HASH(0x187fe20)', 'all_columns', ...) called at C:/Perl/site/lib/Rose/DB/Object/Manager.pm line 1646 Rose::DB::Object::Manager::get_objects('MGORD::Order::Manager', 'require_objects', 'destaddress', 'query', 'ARRAY(0x39b30cc)', 'object_class', 'MGORD::Order') called at C:/Perl/site/lib/Rose/DB/Object/Manager.pm line 205 Rose::DB::Object::Manager::__ANON__('MGORD::Order::Manager', 'require_objects', 'destaddress', 'query', 'ARRAY(0x39b30cc)') called at oprosemgord.pl line 983 main::rose_get_orders('HASH(0x390a37c)') called at opmgdb.pl line 1545 main::gdb_get_orders_test('HASH(0x250f048)') called at C:/Information/mgroot/cgi-bin/opreport.pl line 169 I'm on Rose::DB - 0.734, Rose::DB::Object - 0.764. Am I behind the times or is this a red herring? - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object
Re: [RDBO] Manager queries with secondary table and or
On 1/10/08 5:46 PM, James Masters wrote: I'm on Rose::DB - 0.734, Rose::DB::Object - 0.764. Am I behind the times or is this a red herring? Ah, yes, you're behind the times :) You should upgrade to the latest versions: Rose::DB 0.737 and Rose::DB::Object 0.766. Relevant to your problem is this item from the change list for 0.765: * Fixed a bug that prevented relationship and foreign key names from being resolved when used in nested query parameters. (http://search.cpan.org/src/JSIRACUSA/Rose-DB-0.737/Changes) -John - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object