Class TRALCrudBase

Unit

Declaration

type TRALCrudBase = class(TObject)

Description

TRALCrudBase

Hierarchy

Overview

Fields

Protected FParamNames: TStrings;
Protected FParamValues: TStrings;
Protected FQueryParamNames: TStrings;
Protected FQueryParamValues: TStrings;
Protected FRequest: TRALRequest;
Protected FTable: StringRAL;
Protected FPKName: StringRAL;
Protected FPKValue: StringRAL;

Methods

Public constructor Create(ARequest: TRALRequest); overload;
Public constructor Create; overload;
Public destructor Destroy; override;
Public function CustomQuery(AQuery: StringRAL): TDataSet; virtual; abstract;
Public function Delete: variant; virtual;
Public function Insert: variant; virtual;
Public function ParamNames(Args: array of StringRAL): TRALCrudBase;
Public function ParamsFromKind(AKind: TRALParamKind): TRALCrudBase;
Public function ParamValues(Args: array of const): TRALCrudBase;
Public function PrimaryKey(pkName: StringRAL; pkValue: variant): TRALCrudBase;
Public function QueryParams(names, values: array of const): TRALCrudBase; virtual; abstract;
Public function Read: TDataSet; virtual;
Public function SetRequest(AValue: TRALRequest): TRALCrudBase;
Public function Table(ATable: StringRAL): TRALCrudBase;
Public function Update: variant; virtual;
Public procedure FromHTTPMethod;

Description

Fields

Protected FParamNames: TStrings;
 
Protected FParamValues: TStrings;
 
Protected FQueryParamNames: TStrings;
 
Protected FQueryParamValues: TStrings;
 
Protected FRequest: TRALRequest;
 
Protected FTable: StringRAL;
 
Protected FPKName: StringRAL;
 
Protected FPKValue: StringRAL;
 

Methods

Public constructor Create(ARequest: TRALRequest); overload;
 
Public constructor Create; overload;
 
Public destructor Destroy; override;
 
Public function CustomQuery(AQuery: StringRAL): TDataSet; virtual; abstract;

Runs a custom query

Public function Delete: variant; virtual;

"D" of CRUD acronym, removes values from the database based on previously configured params

Public function Insert: variant; virtual;

"C" of CRUD acronym, inserts data into the database based on previously configured params

Public function ParamNames(Args: array of StringRAL): TRALCrudBase;

sets the names of the parameters which will be used in the CRUD functions

Public function ParamsFromKind(AKind: TRALParamKind): TRALCrudBase;

defines both ParamNames and ParamValues based on the ParamKind in the ARequest attribute

Public function ParamValues(Args: array of const): TRALCrudBase;

sets the values of the parameters which will be used in the CRUD functions respective to paramNames order

Public function PrimaryKey(pkName: StringRAL; pkValue: variant): TRALCrudBase;

defines which param is the primary key

Public function QueryParams(names, values: array of const): TRALCrudBase; virtual; abstract;
 
Public function Read: TDataSet; virtual;

"R" of CRUD acronym, gets values from the database based on previously configured params

Public function SetRequest(AValue: TRALRequest): TRALCrudBase;

defines RALRequest into CRUD Object

Public function Table(ATable: StringRAL): TRALCrudBase;

sets the database table where operations will be performed into

Public function Update: variant; virtual;

"U" of CRUD acronym, updates values in the database based on previously configured params

Public procedure FromHTTPMethod;

Runs the CRUD based on HTTP Verb from the RALRequest following the rules: GET = read; POST = insert; PUT/PATCH = update; DELETE = delete; HEAD, TRACE, OPTIONS = nothing



GitHub Repository
Generated by PasDoc 0.16.0.