| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package EntityModel::Query::Join; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$EntityModel::Query::Join::VERSION = '0.102'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
use EntityModel::Class { |
|
6
|
16
|
|
|
|
|
194
|
'table' => { type => 'EntityModel::Query::JoinTable' }, |
|
7
|
|
|
|
|
|
|
'alias' => { type => 'string' }, |
|
8
|
|
|
|
|
|
|
'type' => { type => 'string' }, |
|
9
|
|
|
|
|
|
|
'on' => { type => 'array', subclass => 'EntityModel::Query::Condition' }, |
|
10
|
16
|
|
|
16
|
|
10530
|
}; |
|
|
16
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
EntityModel::Query::Join - base class for JOIN tables |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 VERSION |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
version 0.102 |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
See L. |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
See L. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 METHODS |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 asString |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub asString { |
|
39
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
40
|
0
|
|
|
|
|
|
my @cond = $self->on->list; |
|
41
|
0
|
|
|
|
|
|
my $sql = $_->type . ' join ' . $self->table->asString . ' as ' . $_->alias; |
|
42
|
0
|
0
|
|
|
|
|
$sql .= ' on ' . join(' and ', map { $_->asString } @cond) if @cond; |
|
|
0
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return $sql; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |