diff Lib/IMPL/SQL/Schema/Column.pm @ 165:76515373dac0

Added Class::Template, Rewritten SQL::Schema 'use parent' directive instead of 'use base'
author wizard
date Sat, 23 Apr 2011 23:06:48 +0400
parents 6ce1f052b90a
children 1f7a6d762394
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema/Column.pm	Mon Mar 28 01:36:24 2011 +0400
+++ b/Lib/IMPL/SQL/Schema/Column.pm	Sat Apr 23 23:06:48 2011 +0400
@@ -1,16 +1,16 @@
 use strict;
 package IMPL::SQL::Schema::Column;
-use base qw(IMPL::Object IMPL::Object::Autofill IMPL::Object::Clonable);
+use parent 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 Type => prop_get;
-    public _direct property CanBeNull => prop_get;
-    public _direct property DefaultValue => prop_get;
-    public _direct property Tag => prop_get;
+    public _direct property name => prop_get;
+    public _direct property type => prop_get;
+    public _direct property isNullable => prop_get;
+    public _direct property defaultValue => prop_get;
+    public _direct property tag => prop_get;
 }
 
 __PACKAGE__->PassThroughArgs;
@@ -18,9 +18,9 @@
 sub CTOR {
     my $this = shift;
     
-    $this->{$Name} or die new IMPL::InvalidArgumentException('a column name is required');
-    $this->{$CanBeNull} = 0 if not exists $this->{$CanBeNull};
-    UNIVERSAL::isa($this->{$Type},'IMPL::SQL::Schema::Type') or die new IMPL::InvalidArgumentException('a type is required for the column',$this->{$Name});
+    $this->{$name} or die new IMPL::InvalidArgumentException('a column name is required');
+    $this->{$isNullable} = 0 if not exists $this->{$isNullable};
+    UNIVERSAL::isa($this->{$type},'IMPL::SQL::Schema::Type') or die new IMPL::InvalidArgumentException('a type is required for the column',$this->{$name});
 }
 
 sub isEqualsStr {
@@ -54,7 +54,7 @@
 sub isSame {
     my ($this,$other) = @_;
     
-    return ($this->{$Name} eq $other->{$Name} and $this->{$CanBeNull} == $other->{$CanBeNull} and isEqualsStr($this->{$DefaultValue}, $other->{$DefaultValue}) and $this->{$Type}->isSame($other->{$Type}));
+    return ($this->{$name} eq $other->{$name} and $this->{$isNullable} == $other->{$isNullable} and isEqualsStr($this->{$defaultValue}, $other->{$defaultValue}) and $this->{$type}->isSame($other->{$type}));
 }
 
 1;