The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ObjectDB::Relationship::ManyToOne - many to one relationship for ObjectDB

SYNOPSIS

    package Article;

    use strict;
    use warnings;

    use base 'ObjectDB';

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

        relationships => {
            author => {
                type  => 'many to one',
                class => 'Author',
                map   => {author_id => 'id'}
            }
        }
    );

    1;

DESCRIPTION

Many to one relationship for ObjectDB.

ATTRIBUTES

map

Hash reference holding columns mappings.

METHODS

new

Returns new ObjectDB::Relationship::ManyToOne instance.

to_source

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

AUTHOR

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT

Copyright (C) 2009, Viacheslav Tykhanovskyi.

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