Hello,

this line in RDBO::Manger.pm bugs me (line 308):

my $with_objects = !$count_only ? delete $args{'with_objects'} : undef;

When doing an count_only it ignores with_objects. But I do a query and
check if there are objects present or not.

>From my code:
        push @withobj, 'monitoring';
        if ($monitoring eq 'ja') {
            $query{t2_ID} = {gt => 0};
        }
        elsif ($monitoring eq 'nein') {
            $query{t2_ID} = undef;
        }

Later @withobj becomes Manager's with_objects parameter.


It is modelled as 'one to many' relation.


Everything works, if I unconditionally assign with_objects (removing the
count_only check). So can we please change this line or introduce
another parameter which overrides this condition?


Thanks,
Uwe


PS: Attached a small typo patch in Metadata.pm.
Index: Rose-DB-Object/lib/Rose/DB/Object/Manager.pm
===================================================================
--- Rose-DB-Object/lib/Rose/DB/Object/Manager.pm        (Revision 1061)
+++ Rose-DB-Object/lib/Rose/DB/Object/Manager.pm        (Arbeitskopie)
@@ -305,7 +305,7 @@
   my $return_iterator  = delete $args{'return_iterator'};
   my $count_only       = delete $args{'count_only'};
   my $require_objects  = delete $args{'require_objects'};
-  my $with_objects     = !$count_only ? delete $args{'with_objects'} : undef;
+  my $with_objects     = delete $args{'with_objects'};
 
   my $skip_first       = delete $args{'skip_first'} || 0;
   my $distinct         = delete $args{'distinct'};
Index: Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm
===================================================================
--- Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm       (Revision 1061)
+++ Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm       (Arbeitskopie)
@@ -4830,7 +4830,7 @@
 
 If a L<Rose::DB::Object::ConventionManager>-derived class name is passed, a 
new object of that class is created with its 
L<meta|Rose::DB::Object::ConventionManager/meta> attribute set to this metadata 
object.  Then it is used as the convention manager for this L<class|/class>.
 
-If a convention manager name is passed, then the corresponding class is looked 
up in the L<convention manager class map|convention_manager_classes>, a new 
object of that class is constructed, its 
L<meta|Rose::DB::Object::ConventionManager/meta> attribute set to this metadata 
object, and it is used as the convention manager for this L<class|/class>.  If 
there is no class mapped to NAME, a fatal error will occur.
+If a convention manager name is passed, then the corresponding class is looked 
up in the L<convention manager class map|convention_manager_classes>, a new 
object of that class is constructed, its 
L<meta|Rose::DB::Object::ConventionManager/meta> attribute is set to this 
metadata object, and it is used as the convention manager for this 
L<class|/class>.  If there is no class mapped to NAME, a fatal error will occur.
 
 See the L<Rose::DB::Object::ConventionManager> documentation for more 
information on convention managers.
 
-------------------------------------------------------------------------
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