AR-131 Applied patch Dave Godfrey
[castle.git] / ActiveRecord / Castle.ActiveRecord / Attributes / Enums.cs
blob7c7cb4960032765342d0a2b340d97c479374325c
1 // Copyright 2004-2007 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
17 using System;
19 /// <summary>
20 /// Defines the values for optimistic locking
21 /// </summary>
22 [Serializable]
23 public enum OptimisticLocking
25 /// <summary>
26 /// do not use optimistic locking
27 /// </summary>
28 None,
30 /// <summary>
31 /// check the version/timestamp columns
32 /// </summary>
33 Version,
35 /// <summary>
36 /// check the changed columns
37 /// </summary>
38 Dirty,
40 /// <summary>
41 /// check all columns
42 /// </summary>
43 All
46 /// <summary>
47 /// Define the polymorphism options
48 /// </summary>
49 [Serializable]
50 public enum Polymorphism
52 /// <summary>
53 /// Implicit polymorphism
54 /// </summary>
55 Implicit,
56 /// <summary>
57 /// Explicit polymorphism
58 /// </summary>
59 Explicit
62 /// <summary>
63 /// Define the caching options
64 /// </summary>
65 [Serializable]
66 public enum CacheEnum
68 /// <summary>
69 /// Default value, no caching
70 /// </summary>
71 Undefined,
72 /// <summary>
73 /// Read only cache - use for cases where no write are performed.
74 /// </summary>
75 ReadOnly,
76 /// <summary>
77 /// Read write cache
78 /// </summary>
79 ReadWrite,
80 /// <summary>
81 /// Read write cache with looser semantics.
82 /// Check NHibernate's documentation for the detials.
83 /// </summary>
84 NonStrictReadWrite
87 /// <summary>
88 /// Define outer join options
89 /// </summary>
90 [Serializable]
91 public enum OuterJoinEnum
93 /// <summary>
94 /// Let NHibernate decide what to do
95 /// </summary>
96 Auto,
97 /// <summary>
98 /// Use outer join
99 /// </summary>
100 True,
101 /// <summary>
102 /// Do not use outer join
103 /// </summary>
104 False
107 /// <summary>
108 /// Define the possible fetch option values
109 /// </summary>
110 public enum FetchEnum
112 /// <summary>
113 /// Let NHibernate decide what to do here
114 /// </summary>
115 Unspecified,
116 /// <summary>
117 /// Use a JOIN to load the data
118 /// </summary>
119 Join,
120 /// <summary>
121 /// Use a seperate SELECT statement to load the data
122 /// </summary>
123 Select
126 /// <summary>
127 /// Defines the cascading behaviour of this association.
128 /// </summary>
129 /// <remarks>
130 /// Entities has associations to other objects, this may be an association to a single item (<see cref="BelongsToAttribute" />)
131 /// or an association to a collection (<see cref="HasManyAttribute" />, <see cref="HasManyToAnyAttribute" />).
132 /// At any rate, you are able to tell NHibernate to automatically traverse an entity's associations, and act according
133 /// to the cascade option. For instance, adding an unsaved entity to a collection with <see cref="CascadeEnum.SaveUpdate" />
134 /// cascade will cause it to be saved along with its parent object, without any need for explicit instructions on our side.
135 /// </remarks>
136 public enum CascadeEnum
138 /// <summary>
139 /// No cascading. This is the default.
140 /// The cascade should be handled manually.
141 /// </summary>
142 None,
143 /// <summary>
144 /// Cascade save, update and delete.
145 /// When the object is saved, updated or deleted, the associations will be checked
146 /// and the objects found will also be saved, updated or deleted.
147 /// </summary>
148 All,
149 /// <summary>
150 /// Cascade save and update.
151 /// When the object is saved or updated, the associations will be checked and any object that requires
152 /// will be saved or updated (including saving or updating the associations in many-to-many scenario).
153 /// </summary>
154 SaveUpdate,
155 /// <summary>
156 /// Cascade delete.
157 /// When the object is deleted, all the objects in the association will be deleted as well.
158 /// </summary>
159 Delete
162 /// <summary>
163 /// Defines the cascading behaviour of this association.
164 /// </summary>
165 /// <remarks>
166 /// Entities has associations to other objects, this may be an association to a single item (<see cref="BelongsToAttribute" />)
167 /// or an association to a collection (<see cref="HasManyAttribute" />, <see cref="HasManyToAnyAttribute" />).
168 /// At any rate, you are able to tell NHibernate to automatically traverse an entity's associations, and act according
169 /// to the cascade option. For instance, adding an unsaved entity to a collection with <see cref="CascadeEnum.SaveUpdate" />
170 /// cascade will cause it to be saved along with its parent object, without any need for explicit instructions on our side.
171 /// </remarks>
172 [Serializable]
173 public enum ManyRelationCascadeEnum
175 /// <summary>
176 /// No cascading. This is the default.
177 /// The cascade should be handled manually.
178 /// </summary>
179 None,
180 /// <summary>
181 /// Cascade save, update and delete.
182 /// When the object is saved, updated or deleted, the associations will be checked
183 /// and the objects found will also be saved, updated or deleted.
184 /// </summary>
185 All,
186 /// <summary>
187 /// Cascade save and update.
188 /// When the object is saved or updated, the associations will be checked and any object that requires
189 /// will be saved or updated (including saving or updating the associations in many-to-many scenario).
190 /// </summary>
191 SaveUpdate,
192 /// <summary>
193 /// Cascade delete.
194 /// When the object is deleted, all the objects in the association will be deleted as well.
195 /// </summary>
196 Delete,
197 /// <summary>
198 /// Cascade save, update and delete, removing orphan children.
199 /// When an object is saved, updated or deleted, the associations will be checked and all objects found
200 /// will be saved, updated or deleted as well.
201 /// In additional to that, when an object is removed from the association and not associated with another object (orphaned), it will also be deleted.
202 /// </summary>
203 AllDeleteOrphan