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
.Framework
.Internal
17 using System
.Reflection
;
20 /// This model is used to represent a dependent object value type (<composite-element/> - in NHibernate talk).
22 public class DependentObjectModel
: IVisitable
24 private readonly HasManyAttribute hasManyAtt
;
25 private readonly ActiveRecordModel dependentObjectModel
;
29 /// Initializes a new instance of the <see cref="DependentObjectModel"/> class.
31 /// <param name="propInfo">The prop info.</param>
32 /// <param name="hasManyAtt">The nested att.</param>
33 /// <param name="dependentObjectModel">The nested model.</param>
34 public DependentObjectModel(PropertyInfo propInfo
, HasManyAttribute hasManyAtt
, ActiveRecordModel dependentObjectModel
)
36 this.dependentObjectModel
= dependentObjectModel
;
37 this.hasManyAtt
= hasManyAtt
;
43 /// <value>The model.</value>
44 public ActiveRecordModel Model
46 get { return dependentObjectModel; }
49 /// Gets the has many attribute
51 /// <value>The has many att.</value>
52 public HasManyAttribute HasManyAtt
54 get { return hasManyAtt; }
57 #region IVisitable Members
60 /// Accepts the specified visitor and call the relevant IVisitor.Visit***() method
62 /// <param name="visitor">The visitor.</param>
63 public void Accept(IVisitor visitor
)
65 visitor
.VisitDependentObject(this);