49
|
1 use strict;
|
|
2 package IMPL::SQL::Schema::Type;
|
|
3 use base qw(IMPL::Object IMPL::Object::Autofill);
|
|
4 use IMPL::Class::Property;
|
|
5 use IMPL::Class::Property::Direct;
|
|
6
|
|
7 BEGIN {
|
|
8 public _direct property Name => prop_get;
|
|
9 public _direct property MaxLength => prop_get;
|
|
10 public _direct property Scale => prop_get;
|
|
11 public _direct property Unsigned => prop_get;
|
|
12 public _direct property Zerofill => prop_get;
|
|
13 public _direct property Tag => prop_get;
|
|
14 }
|
|
15
|
|
16 __PACKAGE__->PassThroughArgs;
|
|
17
|
|
18 sub CTOR {
|
|
19 my $this = shift;
|
|
20
|
|
21 $this->{$Scale} = 0 if not $this->{$Scale};
|
|
22 }
|
|
23
|
|
24 sub isEquals {
|
|
25 my ($a,$b) = @_;
|
|
26
|
|
27 if (defined $a and defined $b) {
|
|
28 return $a == $b;
|
|
29 } else {
|
|
30 if (defined $a or defined $b) {
|
|
31 return 0;
|
|
32 } else {
|
|
33 return 1;
|
|
34 }
|
|
35 }
|
|
36 }
|
|
37
|
|
38 sub isSame {
|
|
39 my ($this,$other) = @_;
|
|
40
|
|
41 return ($this->{$Name} eq $other->{$Name} and isEquals($this->{$MaxLength},$other->{$MaxLength}) and isEquals($this->{$Scale},$other->{$Scale}));
|
|
42 }
|
|
43
|
|
44 1;
|