📄 etyentitymapfield.pas
字号:
unit EtyEntityMapField;
interface
uses
SysUtils, Entity;
const
ENTITY_NAME = 'EntityMapField';
//entity map field
ID_ENTITY_MAP_PATH = 'EntityMap';
ID_LOAD_TYPE = 'LoadType';
ID_FIELDS = 'Fields';
ID_ENTITY_NAME = 'EntityName';
ID_ENTITY_FIELD_NAME = 'EntityFieldName';
ID_TABLE_NAME = 'TableName';
ID_TABLE_FIELD_NAME = 'TableFieldName';
ID_TABLE_FIELD_TYPE = 'TableFieldType';
ID_ISPK = 'IsPK';
type
TEtyEntityMapField = class(TInterfacedObject, IEntity)
private
EntityName : String;
EntityFieldName : String;
TableName : String;
TableFieldName : String;
TableFieldType : String;
IsPK : Boolean;
m_bIsClearValue : boolean;
public
function GetEntityName() : String;
procedure SetAttributeValue(strAttributeName : String; varAttributeValue : Variant);
function GetAttributeValue(strAttributeName : String) : Variant;
function IsAttributeChanged(strAttributeName : String) : Boolean;
procedure SetChangedFlag(bFlag : Boolean);
procedure ClearValue();
function IsClearValue() : boolean;
end;
implementation
//-----------------------------------------------------------------------------
// GetEntityName
//-----------------------------------------------------------------------------
function TEtyEntityMapField.GetEntityName() : String;
begin
// Result := ENTITY_NAME;
Result := 'EntityMapField';
end;
//-----------------------------------------------------------------------------
// SetAttributeValue
//-----------------------------------------------------------------------------
procedure TEtyEntityMapField.SetAttributeValue(strAttributeName : String; varAttributeValue : Variant);
begin
try
strAttributeName := LowerCase(strAttributeName);
if (strAttributeName = LowerCase(ID_ENTITY_NAME)) then
begin
EntityName := varAttributeValue;
end
else if (strAttributeName = LowerCase(ID_ENTITY_FIELD_NAME)) then
begin
EntityFieldName := varAttributeValue;
end
else if (strAttributeName = LowerCase(ID_TABLE_NAME)) then
begin
TableName := varAttributeValue
end
else if (strAttributeName = LowerCase(ID_TABLE_FIELD_NAME)) then
begin
TableFieldName := varAttributeValue
end
else if (strAttributeName = LowerCase(ID_TABLE_FIELD_TYPE)) then
begin
TableFieldType := varAttributeValue
end
else if (strAttributeName = LowerCase(ID_ISPK)) then
begin
IsPK := varAttributeValue
end;
Except
end
end;
//-----------------------------------------------------------------------------
// GetAttributeValue
//-----------------------------------------------------------------------------
function TEtyEntityMapField.GetAttributeValue(strAttributeName : String) : Variant;
var
varAttributeValue : Variant;
begin
try
strAttributeName := LowerCase(strAttributeName);
if (strAttributeName = LowerCase(ID_ENTITY_NAME)) then
varAttributeValue := EntityName
else if (strAttributeName = LowerCase(ID_ENTITY_FIELD_NAME)) then
varAttributeValue := EntityFieldName
else if (strAttributeName = LowerCase(ID_TABLE_NAME)) then
varAttributeValue := TableName
else if (strAttributeName = LowerCase(ID_TABLE_FIELD_NAME)) then
varAttributeValue := TableFieldName
else if (strAttributeName = LowerCase(ID_TABLE_FIELD_TYPE)) then
varAttributeValue := TableFieldType
else if (strAttributeName = LowerCase(ID_ISPK)) then
varAttributeValue := IsPK;
Result := varAttributeValue;
Except
end
end;
//-----------------------------------------------------------------------------
// IsAttributeChanged
//-----------------------------------------------------------------------------
function TEtyEntityMapField.IsAttributeChanged(strAttributeName : String) : Boolean;
begin
Result := true;
end;
//-----------------------------------------------------------------------------
// IsAttributeChanged
//-----------------------------------------------------------------------------
procedure TEtyEntityMapField.SetChangedFlag(bFlag : Boolean);
begin
end;
//-----------------------------------------------------------------------------
// ClearValue
//-----------------------------------------------------------------------------
procedure TEtyEntityMapField.ClearValue();
begin
end;
//-----------------------------------------------------------------------------
// IsClearValue
//-----------------------------------------------------------------------------
function TEtyEntityMapField.IsClearValue() : boolean;
begin
result := m_bIsClearValue;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -