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
.Tests
.Model
.StrictModel
19 using Iesi
.Collections
;
21 public enum ContainerType
28 [ActiveRecord(DiscriminatorColumn
="type", DiscriminatorType
="Int16", DiscriminatorValue
="0")]
29 public class QuestionContainer
: ActiveRecordValidationBase
32 private ContainerType type
;
33 private ISet estratos
= new ListSet();
35 public QuestionContainer()
46 [Property("type", Insert
=false, Update
=false)]
47 public ContainerType Type
53 [HasMany( typeof(Estrato
), Inverse
=true)]
56 get { return estratos; }
57 set { estratos = value; }
60 public static void DeleteAll()
62 ActiveRecordBase
.DeleteAll( typeof(QuestionContainer
) );
65 public static QuestionContainer
Find(int id
)
67 return (QuestionContainer
) ActiveRecordBase
.FindByPrimaryKey( typeof(QuestionContainer
), id
);
70 public override bool Equals(object obj
)
72 QuestionContainer rhs
= obj
as QuestionContainer
;
80 public override int GetHashCode()
82 return id
.GetHashCode();