annotate Lib/IMPL/SQL/Schema/Table.pm @ 94:79bf75223afe

Fixed security related bugs
author wizard
date Thu, 29 Apr 2010 01:31:27 +0400
parents 16ada169ca75
children 6ce1f052b90a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
1 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
2 package IMPL::SQL::Schema::Table;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
3
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
4 use IMPL::SQL::Schema::Column;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
5 use IMPL::SQL::Schema::Constraint;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
6 use IMPL::SQL::Schema::Constraint::PrimaryKey;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
7 use IMPL::SQL::Schema::Constraint::ForeignKey;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
8
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
9 use base qw(IMPL::Object IMPL::Object::Disposable);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
10 use IMPL::Class::Property;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
11 use IMPL::Class::Property::Direct;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
12
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
13 srand time;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
14
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
15 BEGIN {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
16 public _direct property Name => prop_get;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
17 public _direct property Schema => prop_get;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
18 public _direct property Columns => prop_get;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
19 public _direct property Constraints => prop_get;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
20 public _direct property ColumnsByName => prop_none;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
21 public _direct property PrimaryKey => prop_get;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
22 public _direct property Tag => prop_all;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
23 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
24
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
25 sub CTOR {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
26 my ($this,%args) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
28 $this->{$Name} = $args{'Name'} or die new IMPL::InvalidArgumentException('a table name is required');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
29 $this->{$Schema} = $args{'Schema'} or die new IMPL::InvalidArgumentException('a parent schema is required');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
30 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
31
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
32 sub InsertColumn {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
33 my ($this,$column,$index) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
34
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
35 $index = ($this->{$Columns} ? scalar(@{$this->{$Columns}}) : 0) if not defined $index;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
36
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
37 die new IMPL::InvalidArgumentException("The index is out of range") if ($index < 0 || $index > ($this->{$Columns} ? scalar(@{$this->{$Columns}}) : 0));
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
38
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
39 if (UNIVERSAL::isa($column,'IMPL::SQL::Schema::Column')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
40
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
41 } elsif (UNIVERSAL::isa($column,'HASH')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
42 $column = new IMPL::SQL::Schema::Column(%{$column});
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
43 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
44 die new IMPL::InvalidArgumentException("The invalid column parameter");
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
45 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
46
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
47 if (exists $this->{$ColumnsByName}->{$column->Name}) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
48 die new IMPL::InvalidOperationException("The column already exists",$column->name);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
49 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
50 $this->{$ColumnsByName}->{$column->Name} = $column;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
51 splice @{$this->{$Columns}},$index,0,$column;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
52 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
53
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
54 return $column;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
55 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
56
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
57 sub RemoveColumn {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
58 my ($this,$NameOrColumn,$Force) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
59
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
60 my $ColName;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
61 if (UNIVERSAL::isa($NameOrColumn,'IMPL::SQL::Schema::Column')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
62 $ColName = $NameOrColumn->Name;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
63 } elsif (not ref $NameOrColumn) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
64 $ColName = $NameOrColumn;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
65 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
66
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
67 if (exists $this->{$ColumnsByName}->{$ColName}) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
68 my $index = 0;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
69 foreach my $column(@{$this->{$Columns}}) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
70 last if $column->Name eq $ColName;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
71 $index++;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
72 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
73
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
74 my $column = $this->{$Columns}[$index];
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
75 if (my @constraints = $this->GetColumnConstraints($column)){
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
76 $Force or die new IMPL::InvalidOperationException('Can\'t remove column which is used in the constraints',@constraints);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
77 $this->RemoveConstraint($_) foreach @constraints;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
78 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
79
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
80 my $removed = splice @{$this->{$Columns}},$index,1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
81 delete $this->{$ColumnsByName}->{$ColName};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
82 return $removed;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
83 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
84 die new IMPL::InvalidOperationException("The column not found",$NameOrColumn->Name);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
85 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
86 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
87
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
88 sub Column {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
89 my ($this,$name) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
90
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
91 return $this->{$ColumnsByName}->{$name};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
92 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
93
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
94 sub ColumnAt {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
95 my ($this,$index) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
96
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
97 die new IMPL::InvalidArgumentException("The index is out of range") if $index < 0 || $index >= ($this->{$Columns} ? scalar(@{$this->{$Columns}}) : 0);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
98
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
99 return $this->{$Columns}[$index];
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
100 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
101
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
102 sub AddConstraint {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
103 my ($this,$Constraint) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
104
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
105 die new IMPL::InvalidArgumentException('The invalid parameter') if not UNIVERSAL::isa($Constraint,'IMPL::SQL::Schema::Constraint');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
106
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
107 $Constraint->Table == $this or die new IMPL::InvalidOperationException('The constaint must belong to the target table');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
108
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
109 if (exists $this->{$Constraints}->{$Constraint->Name}) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
110 die new IMPL::InvalidOperationException('The table already has the specified constraint',$Constraint->Name);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
111 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
112 if (UNIVERSAL::isa($Constraint,'IMPL::SQL::Schema::Constraint::PrimaryKey')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
113 not $this->{$PrimaryKey} or die new IMPL::InvalidOperationException('The table already has a primary key');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
114 $this->{$PrimaryKey} = $Constraint;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
115 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
116
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
117 $this->{$Constraints}->{$Constraint->Name} = $Constraint;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
118 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
119 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
120
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
121 sub RemoveConstraint {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
122 my ($this,$Constraint,$Force) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
123
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
124 my $cn = UNIVERSAL::isa($Constraint,'IMPL::SQL::Schema::Constraint') ? $Constraint->Name : $Constraint;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
125 $Constraint = $this->{$Constraints}->{$cn} or die new IMPL::InvalidOperationException('The specified constraint doesn\'t exists',$cn);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
126
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
127 if (UNIVERSAL::isa($Constraint,'IMPL::SQL::Schema::Constraint::PrimaryKey')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
128 not scalar keys %{$this->{$PrimaryKey}->ConnectedFK} or die new IMPL::InvalidOperationException('Can\'t remove Primary Key unless some foreign keys referenses it');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
129
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
130 delete $this->{$PrimaryKey};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
131 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
132 $Constraint->Dispose;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
133 delete $this->{$Constraints}->{$cn};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
134 return $cn;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
135 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
136
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
137 sub GetColumnConstraints {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
138 my ($this,@Columns) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
139
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
140 my @cn = map { UNIVERSAL::isa($_ ,'IMPL::SQL::Schema::Column') ? $_ ->Name : $_ } @Columns;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
141 exists $this->{$ColumnsByName}->{$_} or die new IMPL::InvalidOperationException('The specified column isn\'t found',$_) foreach @cn;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
142
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
143 return grep {$_->HasColumn(@cn)} values %{$this->{$Constraints}};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
144 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
145
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
146 sub SetPrimaryKey {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
147 my ($this,@ColumnList) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
148
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
149 $this->AddConstraint(new IMPL::SQL::Schema::Constraint::PrimaryKey(Name => $this->{$Name}.'_PK', Table => $this,Columns => \@ColumnList));
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
150 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
151
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
152 sub LinkTo {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
153 my ($this,$table,@ColumnList) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
154 $table->PrimaryKey or die new IMPL::InvalidOperationException('The referenced table must have a primary key');
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
155 my $constraintName = $this->{$Name}.'_'.$table->Name.'_FK_'.join('_',map {ref $_ ? $_->Name : $_} @ColumnList);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
156 $this->AddConstraint(new IMPL::SQL::Schema::Constraint::ForeignKey(Name => $constraintName, Table => $this,Columns => \@ColumnList, ReferencedTable => $table, ReferencedColumns => $table->PrimaryKey->Columns));
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
157 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
158
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
159 sub Dispose {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
160 my ($this) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
161
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
162 $_->Dispose() foreach values %{$this->{$Constraints}};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
163
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
164 undef %{$this};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
165 $this->SUPER::Dispose();
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
166 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
167
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 33
diff changeset
168 1;