diff Lib/IMPL/SQL/Schema/Type.pm @ 167:1f7a6d762394

SQL schema in progress
author sourcer
date Thu, 12 May 2011 08:57:19 +0400
parents 76515373dac0
children d1676be8afcc
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema/Type.pm	Sat Apr 23 23:12:06 2011 +0400
+++ b/Lib/IMPL/SQL/Schema/Type.pm	Thu May 12 08:57:19 2011 +0400
@@ -1,16 +1,20 @@
 use strict;
+use warnings;
 package IMPL::SQL::Schema::Type;
+
 use parent qw(IMPL::Object IMPL::Object::Autofill);
-use IMPL::Class::Property;
+
+use IMPL::lang qw( :declare :constants :compare );
+
 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;
+    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;
@@ -21,24 +25,14 @@
     $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 {
+sub SameValue {
     my ($this,$other) = @_;
     
-    return ($this->{$name} eq $other->{$name} and isEquals($this->{$maxLength},$other->{$maxLength}) and isEquals($this->{$scale},$other->{$scale}));
+    return (
+    	$this->{$name} eq $other->name
+    	and equals($this->{$maxLength},$other->{$maxLength})
+    	and equals($this->{$scale},$other->{$scale})
+    );
 }
 
 1;