C# Класс 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.
Наследование: Habanero.BO.ClassDefinition.KeyDef, IPrimaryKeyDef
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

Add() публичный Метод

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
Результат void

CreateBOKey() публичный Метод

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
Результат IBOKey

PrimaryKeyDef() публичный Метод

Constructor to create a new primary key definition
public PrimaryKeyDef ( ) : System
Результат System

ToString() публичный Метод

Returns a T:System.String that represents the current T:System.Object.
public ToString ( ) : string
Результат string