1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
18 using System
.Data
.OleDb
;
22 public class ColumnDefinition
25 private bool _primaryKey
;
26 private bool _foreignKey
;
28 private bool _nullable
;
29 private TableDefinition _relatedTable
;
30 private OleDbType _type
= OleDbType
.Empty
;
32 public ColumnDefinition( String name
)
37 public ColumnDefinition(String name
, bool primaryKey
,
38 bool foreignKey
, bool unique
, bool nullable
, OleDbType type
)
41 _primaryKey
= primaryKey
;
42 _foreignKey
= foreignKey
;
48 public ColumnDefinition(String name
, bool primaryKey
,
49 bool foreignKey
, bool unique
, bool nullable
, OleDbType type
,
50 TableDefinition relatedTable
) : this(name
, primaryKey
, foreignKey
, unique
, nullable
, type
)
52 _relatedTable
= relatedTable
;
60 public bool PrimaryKey
62 get { return _primaryKey; }
63 set { _primaryKey = value; }
66 public bool ForeignKey
68 get { return _foreignKey; }
69 set { _foreignKey = value; }
74 get { return _unique; }
75 set { _unique = value; }
78 public TableDefinition RelatedTable
80 get { return _relatedTable; }
81 set { _relatedTable = value; }
86 get { return _nullable; }
87 set { _nullable = value; }
93 set { _type = value; }