Class::ReluctantORM::SQL::From::Join - Represent a JOIN in a SQL statement
use Class::ReluctantORM::SQL::Aliases; # Make three kinds of joins my $join1 = Join->new('INNER', $left_rel, $right_rel, $criterion); my $join2 = Join->new('LEFT OUTER', $left_rel, $right_rel, $criterion); my $join3 = Join->new('CROSS', $left_rel, $right_rel, $criterion); # Make a tree of joins - (a INNER JOIN b) INNER JOIN c my $join4 = Join->new('INNER', $table_a, $table_b, $criterion); my $join5 = Join->new('INNER', $join4, $table_c, $criterion); # Use it in a FROM clause my $from = From->new($join5);
Represents a JOIN in a SQL statement. Inherits from Class::ReluctantORM::SQL::From::Relation .
Each JOIN has two children, a left relation and a right relation. In addition, there is a Criterion that represents the join condition, and a type that represents the JOIN type.
RIGHT OUTER joins are not supported. Transform them into LEFT OUTERs.
NATURAL joins are not supported, because the Criterion must be explicit.
Creates a new Join.
$type must be one of INNER, LEFT OUTER, or CROSS.
$left_rel and $right_rel are Relation subclasses (this includes Tables, Joins, and SubQueries).
$crit is a Criterion specifying the join condition(s).
$relationship is an optional Relationship. This is used as a hint when resolving ambiguities in the SQL, and is optional.
Makes a deep copy of the Join object. All SQL objects are clone()'d, but annotations (such as Relationships) are not.
These methods are inherited from Relation.
Returns a two-element array with the left and right relations. Required by the Relation interface.
Reads or sets the join condition as a Class::ReluctantORM::SQL::Where::Criterion .
Always returns false for this class. Required by the Relation interface.
All objects of this class return true. The class adds this method to its parent class, making all other subclasses of return false.
Reads or sets the left-hand relation of the join condition a Class::ReluctantORM::SQL::From::Relation .
Reads or sets auxiliary relationship data, a Class::ReluctantORM::Relationship.
Reads or sets the right-hand relation of the join condition a Class::ReluctantORM::SQL::From::Relation .
Reads or sets the join type - one of INNER, LEFT OUTER, or CROSS.
Clinton Wolfe
To install Class::ReluctantORM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::ReluctantORM
CPAN shell
perl -MCPAN -e shell install Class::ReluctantORM
For more information on module installation, please visit the detailed CPAN module installation guide.