logo       

Re: all data at once: msg#00028

Subject: Re: all data at once
Dmitriy S. Sinyavskiy wrote:
Hello, Jason.
You write 10 декабря 2007 г., 23:19:41:

JG> Angel Kolev [mailto:ankolev@xxxxxxxxx] wrote:
Thank you.
It works, but only when prefetch only 1 table. If i try to do it with
JG> both:
        my $rs = $c->model('AppModelDB::ClientFemale')->search(undef,
{ join
=>> [qw/ client_family client_male /],
                                                            prefetch
=>> [qw/ client_family client_male /]
                                                          });
.. the result is:
No such relationship client_male at
JG> /usr/local/share/perl/5.8.8/DBIx/Class/Schema.pm line 945
JG> DBIx::Class::Schema::throw_exception('AppModelDB=HASH(0x927aab4)', 'No
JG> such relationship client_male'................etc
I only can use prefetch AppModelDB::ClientFemale -> client_family
JG> andAppModelDB::ClientMale -> client_family. The relationships are
JG> has_many and may_to_many. The "Family" table have
"_PACKAGE__->>belongs_to" for both tables.

JG> Your join and prefetch attributes must be nested hashrefs:

JG>   my $rs = $c->model('AppModelDB::ClientFemale')->search(undef,
JG>     {  join     => { client_family => 'client_male' },
JG>        prefetch => { client_family => 'client_male' },
JG>     {
JG>   );

JG> HTH,
JG> Jason

JG> _______________________________________________
JG> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
JG> IRC: irc.perl.org#dbix-class
JG> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
JG> Searchable Archive:
JG> http://www.grokbase.com/group/dbix-class@xxxxxxxxxxxxxxxxx

 You're too late ) problem was found in schema. He was trying to use
 rel names not created in schema.


Hi again, Dmitriy
Thank you for help. Guess what, i need help now to populate these 3 bases :)
Is this right way:
    my $rs = $c->model('AppModelDB::Family')->search({family_id => undef});
   $rs->populate([{city => $city,state=>$state}]);
$c->stash->{test} = $rs->count; Code above update my family table successfully, but i want to update all bases at once+ 2 more colums (male_id,female_id) to be equal to family_id.

Best regards



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe