2 // System.Data.ObjectSpaces.Schema.ObjectRelationship.cs
\r
5 // Tim Coleman (tim@timcoleman.com)
\r
7 // Copyright (C) Tim Coleman, 2003
\r
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.Data.Mapping;
\r
35 namespace System.Data.ObjectSpaces.Schema {
\r
36 public sealed class ObjectRelationship : IDomainConstraint
\r
41 SchemaClass childClass;
\r
42 SchemaMember childMember;
\r
43 SchemaClass parentClass;
\r
44 SchemaMember parentMember;
\r
45 ObjectRelationshipType type;
\r
46 bool isCascadeDelete;
\r
48 #endregion // Fields
\r
50 #region Constructors
\r
53 public ObjectRelationship (string name, SchemaClass parentClass, SchemaMember parentMember, SchemaClass childClass, SchemaMember childMember, ObjectRelationshipType type)
\r
58 this.parentClass = parentClass;
\r
59 this.parentMember = parentMember;
\r
60 this.childClass = childClass;
\r
61 this.childMember = childMember;
\r
65 public ObjectRelationship (string name, SchemaClass parentClass, SchemaMember parentMember, SchemaClass childClass, SchemaMember childMember, ObjectRelationshipType type, bool isCascadeDelete)
\r
66 : this (name, parentClass, parentMember, childClass, childMember, type)
\r
68 IsCascadeDelete = isCascadeDelete;
\r
71 #endregion // Constructors
\r
75 public SchemaClass ChildClass {
\r
76 get { return childClass; }
\r
79 public SchemaMember ChildMember {
\r
80 get { return childMember; }
\r
84 public ObjectSchema DeclaringObjectSchema {
\r
85 get { throw new NotImplementedException (); }
\r
89 public ExtendedPropertyCollection ExtendedProperties {
\r
90 get { throw new NotImplementedException (); }
\r
93 bool IDomainConstraint.CascadeDelete {
\r
94 get { return IsCascadeDelete; }
\r
98 IDomainSchema IDomainConstraint.DomainSchema {
\r
99 get { throw new NotImplementedException (); }
\r
103 IDomainFieldJoinCollection IDomainConstraint.FieldJoins {
\r
104 get { throw new NotImplementedException (); }
\r
108 IDomainStructure IDomainConstraint.FromDomainStructure {
\r
109 get { throw new NotImplementedException (); }
\r
113 IDomainStructure IDomainConstraint.ToDomainStructure {
\r
114 get { throw new NotImplementedException (); }
\r
117 public bool IsCascadeDelete {
\r
118 get { return isCascadeDelete; }
\r
119 set { isCascadeDelete = value; }
\r
122 public string Name {
\r
123 get { return name; }
\r
124 set { name = value; }
\r
128 public SchemaClass ParentClass {
\r
129 get { return parentClass; }
\r
132 public SchemaMember ParentMember {
\r
133 get { return parentMember; }
\r
136 public ObjectRelationshipType Type {
\r
137 get { return type; }
\r
138 set { type = value; }
\r
141 #endregion // Properties
\r