C# Class Habanero.BO.ClassDefinition.RelKeyDef

This class contains the definition of a Foreign Key that defines the properties RelPropDef that that forms a relationship between two Classes. This class collaborates with the RelPropDef, the ClassDef to provide a definition of the properties involved in the RelationshipDef between two IBusinessObject. This provides an implementation of the Foreign Key Mapping pattern (Fowler (236) - 'Patterns of Enterprise Application Architecture' - 'Maps an association between objects to a foreign Key Reference between tables.') the RelKeyDef should not be used by the Application developer since it is usually constructed based on the mapping in the ClassDef.xml file. The RelKeyDef (Relationship Key Definition) is a list of relationship Property Defs RelPropDef that define the properties that form the persistant relationship definition (RelationshipDef between two Business object defitions (ClassDef. IBusinessObject.
Inheritance: IRelKeyDef
Show file Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
Add ( IRelPropDef relPropDef ) : void

Adds the related property definition to this key, as long as a property by that name has not already been added.

Contains ( string propName ) : bool

Returns true if a property with this name is part of this key.

CreateRelKey ( IBOPropCol lBoPropCol ) : IRelKey

Create a relationship key based on this key definition and its associated property definitions

GetEnumerator ( ) : IEnumerator

Returns an enumerator that iterates through the collection. The enumerator iterates through the values of a Dictionary of IRelPropDef

RelKeyDef ( ) : System

Constructor to create a new RelKeyDef object

this ( string propName ) : IRelPropDef

Provides an indexing facility for the property definitions in this key definition so that they can be accessed like an array (e.g. collection["surname"])

Protected Methods

Method Description
Contains ( IRelPropDef relPropDef ) : bool

Returns true if the specified property is found.

Remove ( IRelPropDef relPropDef ) : void

Removes a Related Property definition from the key

Private Methods

Method Description
IEnumerable ( ) : IEnumerator

Returns an enumerator that iterates through a collection.

Method Details

Add() public method

Adds the related property definition to this key, as long as a property by that name has not already been added.
Thrown if the /// argument passed is null
public Add ( IRelPropDef relPropDef ) : void
relPropDef IRelPropDef The RelPropDef object to be added.
return void

Contains() protected method

Returns true if the specified property is found.
protected Contains ( IRelPropDef relPropDef ) : bool
relPropDef IRelPropDef The Related Property Definition to search for
return bool

Contains() public method

Returns true if a property with this name is part of this key.
public Contains ( string propName ) : bool
propName string The property name to search by
return bool

CreateRelKey() public method

Create a relationship key based on this key definition and its associated property definitions
public CreateRelKey ( IBOPropCol lBoPropCol ) : IRelKey
lBoPropCol IBOPropCol The collection of properties
return IRelKey

GetEnumerator() public method

Returns an enumerator that iterates through the collection. The enumerator iterates through the values of a Dictionary of IRelPropDef
public GetEnumerator ( ) : IEnumerator
return IEnumerator

RelKeyDef() public method

Constructor to create a new RelKeyDef object
public RelKeyDef ( ) : System
return System

Remove() protected method

Removes a Related Property definition from the key
protected Remove ( IRelPropDef relPropDef ) : void
relPropDef IRelPropDef The Related Property Definition to remove
return void

this() public method

Provides an indexing facility for the property definitions in this key definition so that they can be accessed like an array (e.g. collection["surname"])
public this ( string propName ) : IRelPropDef
propName string The name of the property
return IRelPropDef