Mercurial > pub > Impl
diff Lib/IMPL/SQL/Schema/Type.pm @ 49:16ada169ca75
migrating to the Eclipse IDE
author | wizard@linux-odin.local |
---|---|
date | Fri, 26 Feb 2010 10:49:21 +0300 |
parents | 56cef8e3cda6 |
children | 76515373dac0 |
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema/Type.pm Fri Feb 26 01:43:42 2010 +0300 +++ b/Lib/IMPL/SQL/Schema/Type.pm Fri Feb 26 10:49:21 2010 +0300 @@ -1,44 +1,44 @@ -use strict; -package IMPL::SQL::Schema::Type; -use base qw(IMPL::Object IMPL::Object::Autofill); -use IMPL::Class::Property; -use IMPL::Class::Property::Direct; - -BEGIN { - public _direct property Name => prop_get; - public _direct property MaxLength => prop_get; - public _direct property Scale => prop_get; - public _direct property Unsigned => prop_get; - public _direct property Zerofill => prop_get; - public _direct property Tag => prop_get; -} - -__PACKAGE__->PassThroughArgs; - -sub CTOR { - my $this = shift; - - $this->{$Scale} = 0 if not $this->{$Scale}; -} - -sub isEquals { - my ($a,$b) = @_; - - if (defined $a and defined $b) { - return $a == $b; - } else { - if (defined $a or defined $b) { - return 0; - } else { - return 1; - } - } -} - -sub isSame { - my ($this,$other) = @_; - - return ($this->{$Name} eq $other->{$Name} and isEquals($this->{$MaxLength},$other->{$MaxLength}) and isEquals($this->{$Scale},$other->{$Scale})); -} - -1; +use strict; +package IMPL::SQL::Schema::Type; +use base qw(IMPL::Object IMPL::Object::Autofill); +use IMPL::Class::Property; +use IMPL::Class::Property::Direct; + +BEGIN { + public _direct property Name => prop_get; + public _direct property MaxLength => prop_get; + public _direct property Scale => prop_get; + public _direct property Unsigned => prop_get; + public _direct property Zerofill => prop_get; + public _direct property Tag => prop_get; +} + +__PACKAGE__->PassThroughArgs; + +sub CTOR { + my $this = shift; + + $this->{$Scale} = 0 if not $this->{$Scale}; +} + +sub isEquals { + my ($a,$b) = @_; + + if (defined $a and defined $b) { + return $a == $b; + } else { + if (defined $a or defined $b) { + return 0; + } else { + return 1; + } + } +} + +sub isSame { + my ($this,$other) = @_; + + return ($this->{$Name} eq $other->{$Name} and isEquals($this->{$MaxLength},$other->{$MaxLength}) and isEquals($this->{$Scale},$other->{$Scale})); +} + +1;