Namespace: Consultingwerk.Windows.TempTableObjectMapping
Class 
TempTableToObjectMapper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.Windows.TempTableObjectMapping.ITempTableToObjectMapper

File:TempTableToObjectMapper
Purpose:Allows to copy from temp-table fields to .NET value objects
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Thu Dec 18 10:43:59 CET 2014
Notes:SCL-591 https://consultingwerk.atlassian.net/wiki/spaces/SCL/pages/8093786/.NET+Value+object+to+ABL+Temp-Table+mapping
Due to dependency on the System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>
class this class depends on .NET Framework version 4.5
or above. See https://msdn.microsoft.com/en-us//library/hh136548(v=vs.110).aspx



Top Method Summary
Options Name Purpose
# AssignBufferField (handle, character, Object, Type) Assigns a Buffer Field from an Object Value
# AssignRow (Object, handle, character, IReadOnlyDictionary) Assigns all mapped fields in a buffer row
+ CopyFromBuffer (handle, Object, character) Copies the field values form the buffer to the value object
+ CopyFromObject (Object, handle, character, IReadOnlyDictionary, logical) Copies the field values form the buffer to the value object
+ LOGICAL FindBuffer (handle, Object, character) Finds the temp-table buffer based on the field values from the value object
+ LOGICAL FindBuffer (handle, Object, CharacterDictionary, character) Finds the temp-table buffer based on the field values from the value object
# Initialize () Invalidates stored .NET reflection information
# InitializeProperties (handle, Type, character) Initializes the .NET reflection information
# CHARACTER UniqueFindPredicateFromObjectValues (handle, Object, CharacterDictionary) Returns a find string for the buffer based on unqiue indexes of the buffer and the values of the object


Method Detail
Top

PROTECTED AssignBufferField (handle, character, Object, Type)

Purpose: Assigns a Buffer Field from an Object Value
Notes:

Parameters:
phField HANDLE
The Buffer Field to assign to
pcPropertyName CHARACTER
The name of the property
poValue System.Object
The value to assign to the buffer field
poType System.Type
The Property Type (required in case the oValue is null
Top

PROTECTED AssignRow (Object, handle, character, IReadOnlyDictionary)

Purpose: Assigns all mapped fields in a buffer row
Notes: When poBeforeValues is passed, field values will be taken from this Dictionary

Parameters:
poObject System.Object
The object to assign values from
phBuffer HANDLE
The buffer to assign values to
pcProperties CHARACTER
The properties mapping
poBeforeValues System.Collections.Generic.IReadOnlyDictionary
The read only dictionary of before values (optionally)
Top

PUBLIC CopyFromBuffer (handle, Object, character)

Purpose: Copies the field values form the buffer to the value object
Notes:

Parameters:
phBuffer HANDLE
The handle of the source buffer
poObject System.Object
The reference to the target object
pcProperties CHARACTER
The field mapping in the same form as expected by the TempTableFromTypeFactory:CreateTempTable() method
Top

PUBLIC CopyFromObject (Object, handle, character, IReadOnlyDictionary, logical)

Purpose: Copies the field values form the buffer to the value object
Notes: Also for new records (plNewRecord = TRUE) we expect that in phBuffer
a record has already been created
On 10.2B, the 4th parameter, is a IDictionary, as the IReadOnlyDictionary
is not available on .NET 2.0. On OE11 the IReadOnlyDictionary provides
wider access to this method

Parameters:
poObject System.Object
The reference to the target object
phBuffer HANDLE
The handle of the source buffer
pcProperties CHARACTER
The field mapping in the same form as expected by the TempTableFromTypeFactory:CreateTempTable() method
poBeforeValues System.Collections.Generic.IReadOnlyDictionary
An optional dictionary with values to be assigned to the before temp-table row
plNewRecord LOGICAL
Logical value indicating if this routine will be used to create a new record
Top

PUBLIC LOGICAL FindBuffer (handle, Object, character)

Purpose: Finds the temp-table buffer based on the field values from the value object
Notes:

Parameters:
phBuffer HANDLE
The handle of the source buffer
poObject System.Object
The reference to the target object
pcProperties CHARACTER
The field mapping in the same form as expected by the TempTableFromTypeFactory:CreateTempTable() method
Returns LOGICAL
Logical value indicating if the record was found
Top

PUBLIC LOGICAL FindBuffer (handle, Object, CharacterDictionary, character)

Purpose: Finds the temp-table buffer based on the field values from the value object
Notes:

Parameters:
phBuffer HANDLE
The handle of the source buffer
poObject System.Object
The reference to the target object
poMissingValues Consultingwerk.Framework.Collections.CharacterDictionary
The dictionary of character values for index fields from the phBuffer not present in phValueBuffer
pcProperties CHARACTER
The field mapping in the same form as expected by the TempTableFromTypeFactory:CreateTempTable() method
Returns LOGICAL
Logical value indicating if the record was found
Top

PROTECTED Initialize ()

Purpose: Invalidates stored .NET reflection information
Notes:

Top

PROTECTED InitializeProperties (handle, Type, character)

Purpose: Initializes the .NET reflection information
Notes:

Parameters:
phBuffer HANDLE
The handle of the source buffer
poType System.Type
The .NET Type for the target objects
pcProperties CHARACTER
The field mapping in the same form as expected by the TempTableFromTypeFactory:CreateTempTable() method
Top

PROTECTED CHARACTER UniqueFindPredicateFromObjectValues (handle, Object, CharacterDictionary)

Purpose: Returns a find string for the buffer based on unqiue indexes of the
buffer and the values of the object
Notes: It is expected, that InitializeProperties has been executed prior to
executing this method

Parameters:
phBuffer HANDLE
The handle of the buffer to locate
poObject System.Object
The object with the mapped properties
poMissingValues Consultingwerk.Framework.Collections.CharacterDictionary
The dictionary of character values for index fields from the phBuffer not present in phValueBuffer
Returns CHARACTER
The find string


©2006-2020 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       04.02.2020 23:50:27