comparison Lib/IMPL/SQL/Schema/Column.pm @ 168:6148f89bb7bf

IMPL::SQL::Schema::Traits::Diff alfa version IMPL::lang added hash traits
author sourcer
date Mon, 16 May 2011 04:30:38 +0400
parents 1f7a6d762394
children 4d0e1962161c
comparison
equal deleted inserted replaced
167:1f7a6d762394 168:6148f89bb7bf
1 use strict; 1 use strict;
2 package IMPL::SQL::Schema::Column; 2 package IMPL::SQL::Schema::Column;
3 use parent qw(IMPL::Object IMPL::Object::Autofill); 3 use parent qw(IMPL::Object IMPL::Object::Autofill);
4 4
5 use IMPL::lang qw( :DEFAULT :compare :declare :constants ); 5 use IMPL::lang qw( :DEFAULT :compare :declare :constants :hash );
6 use IMPL::Class::Property::Direct; 6 use IMPL::Class::Property::Direct;
7 use IMPL::Exception(); 7 use IMPL::Exception();
8 8
9 BEGIN { 9 BEGIN {
10 public _direct property name => PROP_GET; 10 public _direct property name => PROP_GET;
37 and equals_s($this->{$defaultValue}, $other->{$defaultValue}) 37 and equals_s($this->{$defaultValue}, $other->{$defaultValue})
38 and $this->{$type}->SameValue($other->{$type}) 38 and $this->{$type}->SameValue($other->{$type})
39 ); 39 );
40 } 40 }
41 41
42 sub SetType {
43 my ($this,$newType) = @_;
44
45 $this->{$type} = $newType;
46 }
47
48 sub SetDefaultValue {
49 my ($this,$value) = @_;
50
51 $this->{$defaultValue} = $value;
52 }
53
54 sub SetNullable {
55 my ($this, $value) = @_;
56
57 $this->{$isNullable} = $value;
58 }
59
60 sub SetOptions {
61 my ($this,$diff) = @_;
62
63 return unless ref $diff eq 'HASH';
64
65 $this->tag({}) unless $this->tag;
66
67 hashApply($this->tag,$diff);
68 }
69
42 1; 70 1;