diff Lib/IMPL/SQL/Schema.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children 5c82eec23bb6
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema.pm	Tue Apr 10 08:13:22 2012 +0400
+++ b/Lib/IMPL/SQL/Schema.pm	Tue Apr 10 20:08:29 2012 +0400
@@ -6,10 +6,10 @@
 use IMPL::lang qw(is :declare :constants);
 
 use parent qw(
-	IMPL::Object
-	IMPL::Object::Disposable
-	IMPL::Object::Autofill
-	IMPL::Object::Clonable
+    IMPL::Object
+    IMPL::Object::Disposable
+    IMPL::Object::Autofill
+    IMPL::Object::Clonable
 );
 
 use IMPL::Class::Property::Direct;
@@ -33,9 +33,9 @@
         not exists $this->{$tables}->{$table->name} or die new IMPL::InvalidOperationException('a table with the same name already exists in the database');
     
     } elsif (UNIVERSAL::isa($table,'HASH')) {
-    	
-    	not exists $this->{$tables}->{$table->{'name'}} or die new IMPL::InvalidOperationException('a table with the same name already exists in the database');
-    	$table = { %$table };
+        
+        not exists $this->{$tables}->{$table->{'name'}} or die new IMPL::InvalidOperationException('a table with the same name already exists in the database');
+        $table = { %$table };
         $table->{'schema'} = $this;
         $table = new IMPL::SQL::Schema::Table(%{$table});
     } else {
@@ -62,31 +62,31 @@
 }
 
 sub ResolveTable {
-	my ($this,$table) = @_;
-	
-	UNIVERSAL::isa($table,'IMPL::SQL::Schema::Table') ? $table : $this->{$tables}{$table};
+    my ($this,$table) = @_;
+    
+    UNIVERSAL::isa($table,'IMPL::SQL::Schema::Table') ? $table : $this->{$tables}{$table};
 }
 
 sub GetTable {
-	my ($this,$tableName) = @_;
-	return $this->{$tables}{$tableName};
+    my ($this,$tableName) = @_;
+    return $this->{$tables}{$tableName};
 }
 
 sub GetTables {
-	my ($this) = @_;
-	
-	return wantarray ? values %{$this->{$tables}} : [values %{$this->{$tables}}];
+    my ($this) = @_;
+    
+    return wantarray ? values %{$this->{$tables}} : [values %{$this->{$tables}}];
 }
 
 sub RenameTable {
-	my ($this,$oldName,$newName) = @_;
-	
-	die new IMPL::InvalidOperationException("A source table doesn't exists", $oldName) unless exists $this->{$tables}{$oldName};
-	die new IMPL::InvalidOperationException("A target table already exists", $newName) if exists $this->{$tables}{$newName};
-	
-	my $table = delete $this->{$tables}{$oldName};
-	$table->_setName($newName);
-	$this->{$tables}{$newName} = $table;
+    my ($this,$oldName,$newName) = @_;
+    
+    die new IMPL::InvalidOperationException("A source table doesn't exists", $oldName) unless exists $this->{$tables}{$oldName};
+    die new IMPL::InvalidOperationException("A target table already exists", $newName) if exists $this->{$tables}{$newName};
+    
+    my $table = delete $this->{$tables}{$oldName};
+    $table->_setName($newName);
+    $this->{$tables}{$newName} = $table;
 }
 
 sub Dispose {