comparison Lib/IMPL/SQL/Schema/Constraint.pm @ 271:56364d0c4b4f

+IMPL::SQL::Schema::MySQL: added basic support for MySQL
author cin
date Mon, 28 Jan 2013 02:43:14 +0400
parents 5c82eec23bb6
children 4ddb27ff4a0b
comparison
equal deleted inserted replaced
270:3f59fd828d5f 271:56364d0c4b4f
1 package IMPL::SQL::Schema::Constraint; 1 package IMPL::SQL::Schema::Constraint;
2 use strict; 2 use strict;
3 use warnings; 3 use warnings;
4 4
5 use IMPL::lang qw(:declare is); 5 use IMPL::lang qw(:declare is isclass);
6 6
7 use parent qw(IMPL::Object IMPL::Object::Disposable); 7 use parent qw(IMPL::Object IMPL::Object::Disposable);
8 8
9 use IMPL::Class::Property::Direct; 9 use IMPL::Class::Property::Direct;
10 10
27 } 27 }
28 28
29 sub ResolveColumn { 29 sub ResolveColumn {
30 my ($Table,$Column) = @_; 30 my ($Table,$Column) = @_;
31 31
32 my $cn = UNIVERSAL::isa($Column,'IMPL::SQL::Schema::Column') ? $Column->name : $Column; 32 my $cn = is($Column,'IMPL::SQL::Schema::Column') ? $Column->name : $Column;
33 33
34 my $resolved = $Table->GetColumn($cn); 34 my $resolved = $Table->GetColumn($cn);
35 die new IMPL::InvalidOperationException("The column is not found in the table", $cn, $Table->name) if not $resolved; 35 die new IMPL::InvalidOperationException("The column is not found in the table", $cn, $Table->name) if not $resolved;
36 return $resolved; 36 return $resolved;
37 } 37 }
72 } 72 }
73 73
74 sub ResolveAlias { 74 sub ResolveAlias {
75 my ($self,$alias) = @_; 75 my ($self,$alias) = @_;
76 76
77 return is($alias, typeof IMPL::SQL::Schema::Constraint) ? $alias : $aliases{$alias}; 77 return isclass($alias, typeof IMPL::SQL::Schema::Constraint) ? $alias : $aliases{$alias};
78 } 78 }
79 79
80 sub RegisterAlias { 80 sub RegisterAlias {
81 my ($self,$alias) = @_; 81 my ($self,$alias) = @_;
82 82