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

File:SmartRelationService
Purpose:SmartFramework 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 issues:
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, IRelationServiceQueryCustomizer) 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 GetChildRecordQueryOf (handle, handle, IRelationServiceQueryCustomizer) 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 GetParentDescriptionForFieldValue (character, 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 GetParentRecordForFieldValue (character, 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 GetParentRecordQueryForFieldValue (character, 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
+ HANDLE GetParentRecordQueryOf (handle, handle, IRelationServiceQueryCustomizer) Returns the handle of a query (prepared, opened and located at the first record) of all parent records of the given child record
+ CHARACTER GetParentRoleForChildField (character) Returns the name of the parent role for the given child field
# GetRelationForChildRecord (character, BUFFER) Locates the parent relation buffer for the given child buffer and the
# 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, IRelationServiceQueryCustomizer) Processes the RI rule OnChildUpdateRestrict
# OnParentDeleteCascade (handle, character, IRelationServiceQueryCustomizer, logical) Processes the RI rule OnParentDeleteCascade
# OnParentDeleteNullify (handle, character, character, IRelationServiceQueryCustomizer, logical) Processes the RI rule OnParentDeleteNullify
# OnParentDeleteRestrict (handle, character, IRelationServiceQueryCustomizer) Processes the RI rule OnParentDeleteRestrict
# OnParentDeleteSetDefault (handle, character, character, IRelationServiceQueryCustomizer, logical) Processes the RI rule OnParentDeleteSetDefault
+ ProcessDelete (handle, logical, IRelationServiceQueryCustomizer) Processes the delete of a parent buffer
+ ProcessDelete (handle, logical, IRelationServiceQueryCustomizer, logical) Processes the delete of a parent buffer
+ ProcessWrite (handle, logical, IRelationServiceQueryCustomizer) Processes the write of a child buffer
+ ProcessWrite (handle, logical, IRelationServiceQueryCustomizer, 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, IRelationServiceQueryCustomizer)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
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 GetChildRecordQueryOf (handle, handle, IRelationServiceQueryCustomizer)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
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 GetParentDescriptionForFieldValue (character, 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:
pcChildFieldName CHARACTER
The qualified field name of the child buffer that references the parent table
pcValue CHARACTER
The value to return
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

PROTECTED HANDLE GetParentRecordForFieldValue (character, character)

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

Parameters:
pcChildFieldName CHARACTER
The qualified field name of the child buffer that references the parent table
pcValue CHARACTER
Field Value
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

PROTECTED HANDLE GetParentRecordQueryForFieldValue (character, 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:
pcChildFieldName CHARACTER
The qualified field name of the child buffer that references the parent table
pcValue CHARACTER
The field value
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

PUBLIC HANDLE GetParentRecordQueryOf (handle, handle, IRelationServiceQueryCustomizer)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
Returns HANDLE
The handle of a database query of the parent records
Top

PUBLIC CHARACTER GetParentRoleForChildField (character)

Purpose: Returns the name of the parent role for the given child field
Notes:

Parameters:
pcChildFieldName CHARACTER
The qualified field name of the child buffer that references the parent table
Returns CHARACTER
The name of the parent field
Top

PROTECTED GetRelationForChildRecord (character, BUFFER)

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

Parameters:
pcChildFieldName CHARACTER
The qualified field name of the child buffer that references the parent table
pb_SmartRelation BUFFER
The buffer for the eSmartRelation table
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, IRelationServiceQueryCustomizer)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
Top

PROTECTED OnParentDeleteCascade (handle, character, IRelationServiceQueryCustomizer, logical)

Purpose: Processes the RI rule OnParentDeleteCascade
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
plUseNoWaitForReferentialIntegrity LOGICAL
Use NO-WAIT for exclusive-lock record access
Top

PROTECTED OnParentDeleteNullify (handle, character, character, IRelationServiceQueryCustomizer, logical)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
plUseNoWaitForReferentialIntegrity LOGICAL
Use NO-WAIT for exclusive-lock record access
Top

PROTECTED OnParentDeleteRestrict (handle, character, IRelationServiceQueryCustomizer)

Purpose: Processes the RI rule OnParentDeleteRestrict
Notes:

Parameters:
phParentBuffer HANDLE
The handle of the parent buffer
pcRelationGuid CHARACTER
The GUID of the SmartRelation
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
Top

PROTECTED OnParentDeleteSetDefault (handle, character, character, IRelationServiceQueryCustomizer, logical)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
plUseNoWaitForReferentialIntegrity LOGICAL
Use NO-WAIT for exclusive-lock record access
Top

PUBLIC ProcessDelete (handle, logical, IRelationServiceQueryCustomizer)

Purpose: Processes the delete of a parent buffer
Notes: On delete restrict, on delete cascade
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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
Top

PUBLIC ProcessDelete (handle, logical, IRelationServiceQueryCustomizer, logical)

Purpose: Processes the delete of a parent buffer
Notes: On delete restrict, on delete cascade
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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
plUseNoWaitForReferentialIntegrity LOGICAL
Use NO-WAIT for exclusive-lock record access
Top

PUBLIC ProcessWrite (handle, logical, IRelationServiceQueryCustomizer)

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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
Top

PUBLIC ProcessWrite (handle, logical, IRelationServiceQueryCustomizer, 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
poQueryCustomizer Consultingwerk.Framework.IRelationServiceQueryCustomizer
The optional reference to the IRelationServiceQueryCustomizer instance
plUseNoWaitForReferentialIntegrity LOGICAL
Use NO-WAIT for exclusive-lock record access
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-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:12:09