Namespace: Consultingwerk.SmartFramework.System
Class 
SmartRelationService Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.SmartFramework.IRelationService

File:SmartRelationService
Purpose:SmartFramerwork IRelationService implementation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Thu Apr 04 21:20:03 CEST 2013
Notes:Uses the following SmartMessages for RI related isuses:
VALMSG-5 OnChildUpdateRestrict (ensure that parent record exists)
VALMSG-3 OnParentDeleteRestrict (cannot delete parent because child exists)
Supports the SmartRelationService:2, SmartRelationService:3
and SmartRelationService:4 custom log entry type



Top Method Summary
Options Name Purpose
# HANDLE GetChildRecordQueryOf (handle, character) Returns the handle of a query (prepared, opened and located at the first record) of all child records of the SmartRelation
+ HANDLE GetChildRecordQueryOf (handle, handle) Returns the handle of a query (prepared, opened and located at the first record) of all child records of the given child record
+ HANDLE GetFirstChildRecordOf (handle, character) Returns the first child record of the given child record
+ CHARACTER GetParentDescriptionForField (handle, character) Returns the description value for the parent record referenced by the given field.
+ CHARACTER GetParentDescriptionOf (handle) Returns the description value for the default parent record of the given child buffer
+ HANDLE GetParentRecordForField (handle, character) Returns the first parent record referenced by the given child field
+ HANDLE GetParentRecordOf (handle) Returns the first parent record of the given child record
+ HANDLE GetParentRecordQueryForField (handle, character, handle) Returns the handle of a query (prepared, opened and located at the first record) of all parent records of the given child record
+ HANDLE GetParentRecordQueryOf (handle, handle) Returns the handle of a query (prepared, opened and located at the first record) of all parent records of the given child record
# GetRelationForChildRecord (handle, BUFFER) Locates the default parent relation buffer for the given child buffer
# GetRelationForChildRecord (handle, character, BUFFER) Locates the parent relation buffer for the given child buffer and the
# GetRelationForParentRecord (handle, handle, BUFFER) Locates the child relation buffer for the given parent and child buffer
# OnChildUpdateRestrict (handle, character) Processes the RI rule OnChildUpdateRestrict
# OnParentDeleteCascade (handle, character) Processes the RI rule OnParentDeleteCascade
# OnParentDeleteNullify (handle, character, character) Processes the RI rule OnParentDeleteNullify
# OnParentDeleteRestrict (handle, character) Processes the RI rule OnParentDeleteRestrict
# OnParentDeleteSetDefault (handle, character, character) Processes the RI rule OnParentDeleteSetDefault
+ ProcessDelete (handle, logical) Processes the delete of a parent buffer
+ ProcessWrite (handle, logical) Processes the write of a child buffer
+ RefreshCache () Refreshes the Cache used by the service

Top Constructor Summary
Options Name Purpose
+ SmartRelationService () Constructor for the SmartRelationService class


Method Detail
Top

PROTECTED HANDLE GetChildRecordQueryOf (handle, character)

Purpose: Returns the handle of a query (prepared, opened and located at the
first record) of all child records of the SmartRelation
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the database buffer with the parent record
pcRelationGuid CHARACTER
The GUID of the Relation
Returns HANDLE
The handle of a database query of the child records
Top

PUBLIC HANDLE GetChildRecordQueryOf (handle, handle)

Purpose: Returns the handle of a query (prepared, opened and located at the
first record) of all child records of the given child record
Notes: Based on the first relation between the two tables

Parameters:
phParentBuffer HANDLE
The handle of the database buffer with the parent record
phChildBuffer HANDLE
The handle of the database buffer to add to the query
Returns HANDLE
The handle of a database query of the child records
Top

PUBLIC HANDLE GetFirstChildRecordOf (handle, character)

Purpose: Returns the first child record of the given child record
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the database buffer with the parent record
pcChildTableName CHARACTER
The name of the database table with the child record
Returns HANDLE
The handle of a database buffer with the child record
Top

PUBLIC CHARACTER GetParentDescriptionForField (handle, character)

Purpose: Returns the description value for the parent record referenced by
the given field.
Notes: The parent relation is identified by the child buffer name and the
relation based on the given child field name

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
pcChildFieldName CHARACTER
The unqualified field name of the child buffer that references the parent table
Returns CHARACTER
The description value of the parent record as returned by the ITableInfoProvider.RecordDescription() method
Top

PUBLIC CHARACTER GetParentDescriptionOf (handle)

Purpose: Returns the description value for the default parent record of the
given child buffer
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
Returns CHARACTER
The description value of the parent record as returned by the ITableInfoProvider.RecordDescription() method
Top

PUBLIC HANDLE GetParentRecordForField (handle, character)

Purpose: Returns the first parent record referenced by the given child field
Notes: The parent relation is identified by the child buffer name and the
relation based on the given child field name

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
pcChildFieldName CHARACTER
The unqualified field name of the child buffer that references the parent table
Returns HANDLE
The handle of a database buffer with the parent record
Top

PUBLIC HANDLE GetParentRecordOf (handle)

Purpose: Returns the first parent record of the given child record
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
Returns HANDLE
The handle of a database buffer with the parent record
Top

PUBLIC HANDLE GetParentRecordQueryForField (handle, character, handle)

Purpose: Returns the handle of a query (prepared, opened and located at the
first record) of all parent records of the given child record
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
pcChildFieldName CHARACTER
The unqualified field name of the child buffer that references the parent table
phParentBuffer HANDLE
The handle of the database buffer for the parent record, this buffer will be navigated by the returned query
Returns HANDLE
The handle of a database query of the parent records
Top

PUBLIC HANDLE GetParentRecordQueryOf (handle, handle)

Purpose: Returns the handle of a query (prepared, opened and located at the
first record) of all parent records of the given child record
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
phParentBuffer HANDLE
The handle of the database buffer for the parent record, this buffer will be navigated by the returned query
Returns HANDLE
The handle of a database query of the parent records
Top

PROTECTED GetRelationForChildRecord (handle, BUFFER)

Purpose: Locates the default parent relation buffer for the given child buffer
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
pb_SmartRelation BUFFER
The buffer for the eSmartRelation table
Top

PROTECTED GetRelationForChildRecord (handle, character, BUFFER)

Purpose: Locates the parent relation buffer for the given child buffer
and the
Notes:

Parameters:
phChildBuffer HANDLE
The handle of the database buffer with the child record
pcChildFieldName CHARACTER
The unqualified field name of the child buffer that references the parent table
pb_SmartRelation BUFFER
The buffer for the eSmartRelation table
Top

PROTECTED GetRelationForParentRecord (handle, handle, BUFFER)

Purpose: Locates the child relation buffer for the given parent and child buffer
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the database buffer with the parent record
phChildBuffer HANDLE
The handle of the database buffer with the child record
pb_SmartRelation BUFFER
The buffer for the eSmartRelation table
Top

PROTECTED OnChildUpdateRestrict (handle, character)

Purpose: Processes the RI rule OnChildUpdateRestrict
Notes: Ensures that a parent record exists for parent cardinality 1 or 1n

Parameters:
phChildBuffer HANDLE
The handle of the child buffer
pcParentTableName CHARACTER
The name of the parent buffer
Top

PROTECTED OnParentDeleteCascade (handle, character)

Purpose: Processes the RI rule OnParentDeleteCascade
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
Top

PROTECTED OnParentDeleteNullify (handle, character, character)

Purpose: Processes the RI rule OnParentDeleteNullify
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
pcRelationFields CHARACTER
The field pairs for the data relation
Top

PROTECTED OnParentDeleteRestrict (handle, character)

Purpose: Processes the RI rule OnParentDeleteRestrict
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
Top

PROTECTED OnParentDeleteSetDefault (handle, character, character)

Purpose: Processes the RI rule OnParentDeleteSetDefault
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
pcRelationFields CHARACTER
The field pairs for the data relation
Top

PUBLIC ProcessDelete (handle, logical)

Purpose: Processes the delete of a parent buffer
Notes: On delete restrict, on delete cascase
Optionally deletes the parent buffer as well

Parameters:
phBuffer HANDLE
The handle of the database buffer (parent) to process delete for
plDeleteParent LOGICAL
Logical parameter, indicating of the parent buffer should actually be deleted
Top

PUBLIC ProcessWrite (handle, logical)

Purpose: Processes the write of a child buffer
Notes:

Parameters:
phBuffer HANDLE
The handle of the database buffer (parent) to process the write for
plNewRecord LOGICAL
Logical parameter, indicating if the record has been created or updated
Top

PUBLIC RefreshCache ()

Purpose: Refreshes the Cache used by the service
Notes: Caches data from the Consultingwerk.SmartFramework.System.RelationBusinessEntity



Constructor Detail
Top

PUBLIC SmartRelationService ()

Purpose: Constructor for the SmartRelationService class
Notes:



Temp-Table Detail


©2006-2019 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.08.2019 23:53:12