Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Experiments / Attic / Generator / Castle.ActiveRecord.Generator.Components / IRelationshipBuilder.cs
blob13ee48087e4adec3c4e1b81284eeca6085311d77
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
17 using System;
19 using Castle.ActiveRecord.Generator.Components.Database;
21 public enum AssociationEnum
23 Undefined,
24 HasMany,
25 BelongsTo,
26 HasAndBelongsToMany
29 public interface IRelationshipBuilder
31 ActiveRecordPropertyRelationDescriptor Build(RelationshipInfo info);
34 public class RelationshipInfo
36 private AssociationEnum association;
37 private TableDefinition associationTable;
38 private ColumnDefinition parentCol;
39 private ColumnDefinition childCol;
40 private ActiveRecordDescriptor descriptor;
41 private ActiveRecordDescriptor targetDescriptor;
42 private String where;
43 private String orderBy;
44 private String outerJoin;
45 private String cascade;
46 private bool insert;
47 private bool update;
48 private bool useProxy;
49 private bool invert;
50 private bool lazy;
52 public RelationshipInfo(AssociationEnum association, ActiveRecordDescriptor descriptor, ActiveRecordDescriptor targetDescriptor)
54 if (association == AssociationEnum.Undefined) throw new ArgumentException("association");
55 if (descriptor == null) throw new ArgumentNullException("descriptor");
56 if (targetDescriptor == null) throw new ArgumentNullException("targetDescriptor");
58 this.association = association;
59 this.descriptor = descriptor;
60 this.targetDescriptor = targetDescriptor;
63 public AssociationEnum Association
65 get { return association; }
68 public ActiveRecordDescriptor Descriptor
70 get { return descriptor; }
73 public ActiveRecordDescriptor TargetDescriptor
75 get { return targetDescriptor; }
78 public TableDefinition AssociationTable
80 get { return associationTable; }
81 set { associationTable = value; }
84 public ColumnDefinition ParentCol
86 get { return parentCol; }
87 set { parentCol = value; }
90 public ColumnDefinition ChildCol
92 get { return childCol; }
93 set { childCol = value; }
96 public string Where
98 get { return where; }
99 set { where = value; }
102 public string OrderBy
104 get { return orderBy; }
105 set { orderBy = value; }
108 public string OuterJoin
110 get { return outerJoin; }
111 set { outerJoin = value; }
114 public bool UseProxy
116 get { return useProxy; }
117 set { useProxy = value; }
120 public bool Inverse
122 get { return invert; }
123 set { invert = value; }
126 public String Cascade
128 get { return cascade; }
129 set { cascade = value; }
132 public bool Insert
134 get { return insert; }
135 set { insert = value; }
138 public bool Update
140 get { return update; }
141 set { update = value; }
144 public bool Lazy
146 get { return lazy; }
147 set { lazy = value; }