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
.Tests
.Model
.CompositeNested
18 using System
.Collections
;
21 public class CompositeNestedParent
: ActiveRecordBase
24 private IList dependents
;
26 [PrimaryKey(PrimaryKeyType
.Native
)]
33 [HasMany(typeof(Dependent
), "Parent_Id", "CompositeNestedParent_Dependent" , DependentObjects
= true)]
34 public IList Dependents
36 get { return dependents; }
37 set { dependents = value; }
40 public static void DeleteAll()
42 DeleteAll(typeof(CompositeNestedParent
));
45 public static CompositeNestedParent
[] FindAll()
47 return (CompositeNestedParent
[])FindAll(typeof(CompositeNestedParent
));
50 public static CompositeNestedParent
Find(int id
)
52 return (CompositeNestedParent
)FindByPrimaryKey(typeof(CompositeNestedParent
), id
);
57 public class Dependent
59 private DateTime dateProp
;
60 private NestedDependent nestedDependentProp
;
63 public NestedDependent NestedDependentProp
65 get { return nestedDependentProp; }
66 set { nestedDependentProp = value; }
70 public DateTime DateProp
72 get { return dateProp; }
73 set { dateProp = value; }
77 public class NestedDependent
80 private InnerNestedDependant innerNestedDependantProp
;
85 get { return intProp; }
86 set { intProp = value; }
90 public InnerNestedDependant InnerNestedDependantProp
92 get { return innerNestedDependantProp;}
95 innerNestedDependantProp
= value;
100 public class InnerNestedDependant
102 private string stringProp
;
105 public string StringProp
107 get { return stringProp; }
108 set { stringProp = value; }