C# Class Habanero.BO.ClassDefinition.PrimaryKeyDef

Manages the definition of the primary key in a for a particular Business Object (e.g. Customer). The Primary Key Definition defins the properties of the object that are used to map the business object to the database. The Primary key def is a mapping that is used to implement the Identity Field (216) Pattern (Fowler - 'Patterns of Enterprise Application Architecture') In most cases the PrimaryKeyDefinition will only have one property definition and this property definition will be for an immutable property. In the ideal case this property definition will represent a property that is globally unique. In these cases the primaryKeyDef will have the flag mIsGUIDObjectID set to true. However we have in many cases had to extend or replace existing systems that use mutable composite keys to identify objects in the database. The primary key definition allows you to define all of these scenarious. The Application developer should not usually deal with this class since it is usually created based on the class definition modelled and stored in the ClassDef.Xml XmlPrimaryKeyLoader.
Inheritance: Habanero.BO.ClassDefinition.KeyDef, IPrimaryKeyDef
Datei anzeigen Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
Add ( IPropDef propDef ) : void

Adds a property definition to this key

CreateBOKey ( IBOPropCol lBOPropCol ) : IBOKey

Creates a new business object key (BOKey) using this key definition and its property definitions. Creates either a new BOObjectID object (if the primary key is the object's ID) or a BOPrimaryKey object.

PrimaryKeyDef ( ) : System

Constructor to create a new primary key definition

ToString ( ) : string

Returns a T:System.String that represents the current T:System.Object.

Method Details

Add() public method

Adds a property definition to this key
Thrown if the primary key definition is marked as and object id but more than one /// property definition is being added
public Add ( IPropDef propDef ) : void
propDef IPropDef The property definition to add
return void

CreateBOKey() public method

Creates a new business object key (BOKey) using this key definition and its property definitions. Creates either a new BOObjectID object (if the primary key is the object's ID) or a BOPrimaryKey object.
public CreateBOKey ( IBOPropCol lBOPropCol ) : IBOKey
lBOPropCol IBOPropCol The master property collection
return IBOKey

PrimaryKeyDef() public method

Constructor to create a new primary key definition
public PrimaryKeyDef ( ) : System
return System

ToString() public method

Returns a T:System.String that represents the current T:System.Object.
public ToString ( ) : string
return string