Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Experiments / Attic / Generator / Castle.ActiveRecord.Generator.Components / Database / TableDefinition.cs
blob701078b235c86b6d754faaaf8ba57e00022b394a
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.ActiveRecord.Generator.Components.Database
17 using System;
18 using System.Collections;
21 [Serializable]
22 public class TableDefinition
24 private ArrayList _hasRelation = new ArrayList();
25 private DatabaseDefinition _db;
26 private String _name;
27 private ActiveRecordDescriptor _relatedDescriptor;
28 private ColumnDefinitionCollection _columns = new ColumnDefinitionCollection();
30 public TableDefinition(String name, DatabaseDefinition db)
32 _name = name;
33 _db = db;
36 public void AddManyRelation(TableDefinition def)
38 if (!_hasRelation.Contains(def))
40 _hasRelation.Add(def);
44 public String Name
46 get { return _name; }
49 public ActiveRecordDescriptor RelatedDescriptor
51 get { return _relatedDescriptor; }
52 set { _relatedDescriptor = value; }
55 public ColumnDefinition AddColumn( ColumnDefinition column )
57 _columns.Add( column );
58 return column;
61 public ColumnDefinitionCollection Columns
63 get { return _columns; }
66 public IList TablesReferencedByHasRelation
68 get { return _hasRelation; }
71 public DatabaseDefinition DatabaseDefinition
73 get { return _db; }
74 set { _db = value; }
77 public override String ToString()
79 return _name;