NAME

Async::ORM::Relationship::OneToMany - one to many relationship for Async::ORM

SYNOPSIS

package Article;

use Any::Moose;

extends 'Async::ORM';

__PACKAGE__->schema(
    table          => 'article',
    columns        => [qw/ id category_id author_id title /],
    primary_keys   => ['id'],
    auto_increment => 'id',

    relationships => {
        comments => {
            type  => 'one to many',
            class => 'Comment',
            map   => {id => 'comment_id'}
        }
    }
);

1;

DESCRIPTION

One to many relationship for Async::ORM.

ATTRIBUTES

map

Hash reference holding columns mappings.

METHODS

new

Returns new Async::ORM::Relationship::OneToMany instance.

to_source

Returns generated join arguments that are passed to the sql generator. Used internally.

AUTHOR

Viacheslav Tikhanovskii, vti@cpan.org.

COPYRIGHT

Copyright (C) 2009, Viacheslav Tikhanovskii.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.