On 10/13/06, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
> Right now I have this:
>
> $classAB= Rose::DB::Object::Manager->get_objects(
>                                 object_class=> "A"
>                                 with_objects=> ['B'],
>                                 query=> [
>                                         id=> $kw_args{'id'} ,
>                                 ],
>                 );

So you want to get an A with its associated B, and if no such
associated B exists, you want that Manager call to create one?  If so,
in memory or in the database?

Either way, the answer is that the Manager won't auto-create objects
that don't exist in the database.  If you just want to do the rough
equivalent of this:

> $classAB= Rose::DB::Object::A->new(
>                                         id=> $kw_args{'id'} ,
>                 );
> $classAB->{'B'}= Rose::DB::Object::B->new(
>                                         id=> $kw_args{'id'} ,
>                 );

Then why not just do this:

    $a = A->new(id => 123);
    $b = B->new(id => 123);
    $a->b($b);

    $a->save; # save A and its associated B

-John

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to