OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable Class Reference

Returns cacheable DataTables for DB tables in the MPersonnel.Unit sub-namespace that can be cached on the Client side. More...

Inheritance diagram for Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable:
Ict.Petra.Shared.TCacheableTablesLoader

Public Member Functions

 TPersonnelCacheable ()
 constructor More...
 
DataTable GetCacheableTable (TCacheableUnitTablesEnum ACacheableTable, String AHashCode, Boolean ARefreshFromDB, out System.Type AType, TDataBase ADataBase=null)
 Returns a certain cachable DataTable that contains all columns and all rows of a specified table. More...
 
TSubmitChangesResult SaveChangedStandardCacheableTable (TCacheableUnitTablesEnum ACacheableTable, ref TTypedDataTable ASubmitTable, out TVerificationResultCollection AVerificationResult, TDataBase ADataBase=null)
 Saves a specific Cachable DataTable. The whole DataTable needs to be submitted, not just changes to it! More...
 
DataTable GetCacheableTable (TCacheableUnitTablesEnum ACacheableTable)
 Returns a certain cachable DataTable that contains all columns and all rows of a specified table. More...
 
DataTable ResultingCachedDataTable (String ATableName, String AHashCode, out System.Type AType)
 Returns a DataTable from the Cache if the HashCode of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise it returns nil. More...
 
DataTable ResultingCachedDataTable (String ATableName, String AHashCode, DataView ACacheableTableDV, out System.Type AType)
 Returns a DataTable from the Cache if the HashCode of the DataView of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise it returns nil. More...
 

Protected Attributes

TCacheableTablesManager FCacheableTablesManager
 Holds reference to an instance of TCacheableTablesManager More...
 

Properties

TCacheableTablesManager CacheableTablesManager [get, set]
 Used for passing in an instance of TCacheableTablesManager More...
 

Detailed Description

Returns cacheable DataTables for DB tables in the MPersonnel.Unit sub-namespace that can be cached on the Client side.

Returns cacheable DataTables for DB tables in the MPersonnel.Unit sub-namespace that can be cached on the Client side.

Examples of such tables are tables that form entries of ComboBoxes or Lists and which would be retrieved numerous times from the Server as UI windows are opened.

Constructor & Destructor Documentation

◆ TPersonnelCacheable()

Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable.TPersonnelCacheable ( )
inline

constructor

Member Function Documentation

◆ GetCacheableTable() [1/2]

DataTable Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable.GetCacheableTable ( TCacheableUnitTablesEnum  ACacheableTable)
inline

Returns a certain cachable DataTable that contains all columns and all rows of a specified table.

@comment Wrapper for other GetCacheableTable method

Parameters
ACacheableTableTells what cacheable DataTable should be returned.
Returns
DataTable

◆ GetCacheableTable() [2/2]

DataTable Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable.GetCacheableTable ( TCacheableUnitTablesEnum  ACacheableTable,
String  AHashCode,
Boolean  ARefreshFromDB,
out System.Type  AType,
TDataBase  ADataBase = null 
)
inline

Returns a certain cachable DataTable that contains all columns and all rows of a specified table.

@comment Uses Ict.Petra.Shared.CacheableTablesManager to store the DataTable once its contents got retrieved from the DB. It returns the cached DataTable from it on subsequent calls, therefore making more no further DB queries!

@comment All DataTables are retrieved as Typed DataTables, but are passed out as a normal DataTable. However, this DataTable can be cast by the caller to the appropriate TypedDataTable to have access to the features of a Typed DataTable!

Parameters
ACacheableTableTells what cacheable DataTable should be returned.
AHashCodeHash of the cacheable DataTable that the caller has. '' can be specified to always get a DataTable back (see

)

Parameters
ARefreshFromDBSet to true to reload the cached DataTable from the DB and through that refresh the Table in the Cache with what is now in the DB (this would be done when it is known that the DB Table has changed). The CacheableTablesManager will notify other Clients that they need to retrieve this Cacheable DataTable anew from the PetraServer the next time the Client accesses the Cacheable DataTable. Otherwise set to false.
ATypeThe Type of the DataTable (useful in case it's a Typed DataTable)
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then a separate DB Connection will be established automatically and get closed automatically after it got used.
Returns
DataTable If the Hash that got passed in AHashCode doesn't fit the Hash that the CacheableTablesManager has for this cacheable DataTable, the specified DataTable is returned, otherwise nil.

◆ ResultingCachedDataTable() [1/2]

DataTable Ict.Petra.Shared.TCacheableTablesLoader.ResultingCachedDataTable ( String  ATableName,
String  AHashCode,
DataView  ACacheableTableDV,
out System.Type  AType 
)
inlineinherited

Returns a DataTable from the Cache if the HashCode of the DataView of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise it returns nil.

Parameters
ATableNameName of the DataTable
AHashCodeHashCode that should be compared against the HashCode of the DataView of the DataTable in the Cache
ACacheableTableDVDataView for which HashCode and TableSize should be calculated
ATypeType of the DataTable in the Cache. This is only useful for Typed DataTables
Returns
DataTable from the Cache if the HHashCode of the DataView of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise nil

◆ ResultingCachedDataTable() [2/2]

DataTable Ict.Petra.Shared.TCacheableTablesLoader.ResultingCachedDataTable ( String  ATableName,
String  AHashCode,
out System.Type  AType 
)
inlineinherited

Returns a DataTable from the Cache if the HashCode of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise it returns nil.

Parameters
ATableNameName of the DataTable
AHashCodeHashCode that should be compared against the HashCode of the DataTable in the Cache
ATypeType of the DataTable in the Cache. This is only useful for Typed DataTables
Returns
DataTable from the Cache if the HashCode of the DataTable in the Cache doesn't fit the HashCode that is passed in, otherwise nil

◆ SaveChangedStandardCacheableTable()

TSubmitChangesResult Ict.Petra.Server.MPersonnel.Unit.Cacheable.TPersonnelCacheable.SaveChangedStandardCacheableTable ( TCacheableUnitTablesEnum  ACacheableTable,
ref TTypedDataTable  ASubmitTable,
out TVerificationResultCollection  AVerificationResult,
TDataBase  ADataBase = null 
)
inline

Saves a specific Cachable DataTable. The whole DataTable needs to be submitted, not just changes to it!

Uses Ict.Petra.Shared.CacheableTablesManager to store the DataTable once its saved successfully to the DB, which in turn tells all other Clients that they need to reload this Cacheable DataTable the next time something in the Client accesses it.

Parameters
ACacheableTableName of the Cacheable DataTable with changes.
ASubmitTableCacheable DataTable with changes. The whole DataTable needs to be submitted, not just changes to it!
AVerificationResultWill be filled with any VerificationResults if errors occur.
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then a separate DB Connection will be established automatically and get closed automatically after it got used.
Returns
Status of the operation.

Member Data Documentation

◆ FCacheableTablesManager

TCacheableTablesManager Ict.Petra.Shared.TCacheableTablesLoader.FCacheableTablesManager
protectedinherited

Holds reference to an instance of TCacheableTablesManager

Property Documentation

◆ CacheableTablesManager

TCacheableTablesManager Ict.Petra.Shared.TCacheableTablesLoader.CacheableTablesManager
getsetinherited

Used for passing in an instance of TCacheableTablesManager


The documentation for this class was generated from the following files: