1 // Copyright 2004-2008 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
20 /// Used when a constraint requires a hilo algorithm
23 /// public class Blog : ActiveRecordBase
27 /// [HasManyAndBelongs/HasMany,
28 /// CollectionID(CollectionIDAttribute.HiLo),
32 /// get { return _id; }
33 /// set { _id = value; }
36 [AttributeUsage(AttributeTargets
.Property
, AllowMultiple
=false), Serializable
]
37 public class HiloAttribute
: Attribute
39 private String _column
;
40 private String _table
;
44 /// Initializes a new instance of the <see cref="HiloAttribute"/> class.
46 public HiloAttribute() : this("hi_value", "next_value", 100)
51 /// Initializes a new instance of the <see cref="HiloAttribute"/> class.
53 /// <param name="table">The table.</param>
54 /// <param name="column">The column.</param>
55 /// <param name="maxlo">The maxlo.</param>
56 public HiloAttribute(string table
, String column
, int maxlo
)
64 /// Gets or sets the column name
66 /// <value>The column.</value>
69 get { return _column; }
70 set { _column = value; }
74 /// Gets or sets the table name
76 /// <value>The table.</value>
79 get { return _table; }
80 set { _table = value; }
84 /// Gets or sets the max low value
86 /// <value>The max lo.</value>
89 get { return _maxlo; }
90 set { _maxlo = value; }