C# Class Habanero.BO.ClassDefinition.SingleRelationshipDef

Defines a relationship where the owner relates to only one other object.
Inheritance: RelationshipDef, ISingleRelationshipDef
Datei anzeigen Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
CreateRelationship ( IBusinessObject owningBo, IBOPropCol lBOPropCol ) : IRelationship

Overrides abstract method of RelationshipDef to create a new relationship

SetAsCompulsory ( ) : void

Sets the single relationship as compulsory. If this is set to true then the relationship is treated as compulsory else it uses the algorithm of Checking that all the ForeignKey Props are compulsory. This is primarily used by the Reflective ClassDefLoaders in Habanero.Smooth to load ClassDefinitions based on the BusinessObject.

SetAsOneToOne ( ) : void

Sets this SingleRelationshipDef as a One To One. This overrides the default of it being set to ManyToOne. This is used by the Reflective ClassDefLoaders in Habanero.Smooth to load ClassDefinitions based on the BusinessObject.

SingleRelationshipDef ( string relationshipName, Type relatedObjectClassType, RelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction ) : System

Constructor to create a new single relationship definition

SingleRelationshipDef ( string relationshipName, string relatedObjectAssemblyName, string relatedObjectClassName, IRelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction ) : System

Constructor to create a new single relationship definition

SingleRelationshipDef ( string relationshipName, string relatedObjectAssemblyName, string relatedObjectClassName, IRelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction, InsertParentAction insertParentAction, RelationshipType relationshipType ) : System

Constructs a single Relationship

Private Methods

Method Description
AreAllPropsCompulsory ( ) : bool

Returns true if this RelationshipDef is compulsory. This relationship def will be considered to be compulsory if this OwningBOHasForeignKey and all the IPropDef's that make up the IRelKeyDef are compulsory

GetReverseRelationshipDef ( ) : IRelationshipDef
HasReverseRelationshipDefined ( ) : bool
PropDefIsCompulsory ( IRelPropDef def ) : bool
ReverseRelationshipIsSingle ( ) : bool

Method Details

CreateRelationship() public method

Overrides abstract method of RelationshipDef to create a new relationship
public CreateRelationship ( IBusinessObject owningBo, IBOPropCol lBOPropCol ) : IRelationship
owningBo IBusinessObject The business object that will manage /// this relationship
lBOPropCol IBOPropCol The collection of properties
return IRelationship

SetAsCompulsory() public method

Sets the single relationship as compulsory. If this is set to true then the relationship is treated as compulsory else it uses the algorithm of Checking that all the ForeignKey Props are compulsory. This is primarily used by the Reflective ClassDefLoaders in Habanero.Smooth to load ClassDefinitions based on the BusinessObject.
public SetAsCompulsory ( ) : void
return void

SetAsOneToOne() public method

Sets this SingleRelationshipDef as a One To One. This overrides the default of it being set to ManyToOne. This is used by the Reflective ClassDefLoaders in Habanero.Smooth to load ClassDefinitions based on the BusinessObject.
public SetAsOneToOne ( ) : void
return void

SingleRelationshipDef() public method

Constructor to create a new single relationship definition
public SingleRelationshipDef ( string relationshipName, Type relatedObjectClassType, RelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction ) : System
relationshipName string A name for the relationship
relatedObjectClassType System.Type The class type of the related object
relKeyDef RelKeyDef The related key definition
keepReferenceToRelatedObject bool Whether to keep a /// reference to the related object. Could be false for memory- /// intensive applications.
deleteParentAction DeleteParentAction
return System

SingleRelationshipDef() public method

Constructor to create a new single relationship definition
public SingleRelationshipDef ( string relationshipName, string relatedObjectAssemblyName, string relatedObjectClassName, IRelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction ) : System
relationshipName string A name for the relationship
relatedObjectAssemblyName string The assembly name of the related object
relatedObjectClassName string The class name of the related object
relKeyDef IRelKeyDef The related key definition
keepReferenceToRelatedObject bool Whether to keep a /// reference to the related object. Could be false for memory- /// intensive applications.
deleteParentAction DeleteParentAction
return System

SingleRelationshipDef() public method

Constructs a single Relationship
public SingleRelationshipDef ( string relationshipName, string relatedObjectAssemblyName, string relatedObjectClassName, IRelKeyDef relKeyDef, bool keepReferenceToRelatedObject, DeleteParentAction deleteParentAction, InsertParentAction insertParentAction, RelationshipType relationshipType ) : System
relationshipName string
relatedObjectAssemblyName string
relatedObjectClassName string
relKeyDef IRelKeyDef
keepReferenceToRelatedObject bool
deleteParentAction DeleteParentAction
insertParentAction InsertParentAction
relationshipType RelationshipType
return System