
SQL::Entity::Relationship - Entities Relationship abstraction layer.

use SQL::Entity::Relationship ':all';
use SQL::Entity::Column ':all';
use SQL::Entity::Table;
use SQL::Entity::Condition ':all';
my $dept = SQL::Entity::Table->new(
name => 'dept',
alias => 'd',
columns => [
sql_column(name => 'deptno'),
sql_column(name => 'dname')
],
);
my $emp = SQL::Entity->new(
name => 'emp',
primary_key => ['empno'],
unique_expression => 'rowid',
columns => [
sql_column(name => 'ename'),
sql_column(name => 'empno'),
sql_column(name => 'deptno')
],
);
$emp->add_to_one_relationships(sql_relationship(
target_entity => $dept,
condition => sql_cond($dept->column('deptno'), '=', $entity->column('deptno'))
));

Represents relationship between entities.
sql_relationship by all tag.
Return join condition.
Return SQL condition fragment.
Returns join columns values.
Returns condition for join columns.
Returns order by sql fragment.
Associated the other end.
Creates a new relation object.

SQL::Entity SQL::Entity::Column

The SQL::Entity::Relationship module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

Adrian Witas, adrian@webapp.strefa.pl