mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
This commit is contained in:
parent
f935895054
commit
0fac2dd2fa
@ -1,7 +1,7 @@
|
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{70BE99D7-37AE-4063-9A7C-4A9E9A5600D3}</ProjectGuid>
|
<ProjectGuid>{70BE99D7-37AE-4063-9A7C-4A9E9A5600D3}</ProjectGuid>
|
||||||
<ProjectVersion>19.1</ProjectVersion>
|
<ProjectVersion>19.4</ProjectVersion>
|
||||||
<FrameworkType>VCL</FrameworkType>
|
<FrameworkType>VCL</FrameworkType>
|
||||||
<MainSource>UsingServerInDLL.dpr</MainSource>
|
<MainSource>UsingServerInDLL.dpr</MainSource>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
@ -104,10 +104,6 @@
|
|||||||
<DesignClass>TWebModule</DesignClass>
|
<DesignClass>TWebModule</DesignClass>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
<DCCReference Include="..\REST\CONTROLLERS\REST.MainController.pas"/>
|
<DCCReference Include="..\REST\CONTROLLERS\REST.MainController.pas"/>
|
||||||
<BuildConfiguration Include="Release">
|
|
||||||
<Key>Cfg_2</Key>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</BuildConfiguration>
|
|
||||||
<BuildConfiguration Include="Base">
|
<BuildConfiguration Include="Base">
|
||||||
<Key>Base</Key>
|
<Key>Base</Key>
|
||||||
</BuildConfiguration>
|
</BuildConfiguration>
|
||||||
@ -115,6 +111,10 @@
|
|||||||
<Key>Cfg_1</Key>
|
<Key>Cfg_1</Key>
|
||||||
<CfgParent>Base</CfgParent>
|
<CfgParent>Base</CfgParent>
|
||||||
</BuildConfiguration>
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
@ -132,13 +132,13 @@
|
|||||||
</Excluded_Packages>
|
</Excluded_Packages>
|
||||||
</Delphi.Personality>
|
</Delphi.Personality>
|
||||||
<Deployment Version="3">
|
<Deployment Version="3">
|
||||||
<DeployFile LocalName="Win32\Debug\UsingServerInDLL.exe" Configuration="Debug" Class="ProjectOutput"/>
|
|
||||||
<DeployFile LocalName="..\bin\UsingServerInDLL.exe" Configuration="Debug" Class="ProjectOutput">
|
<DeployFile LocalName="..\bin\UsingServerInDLL.exe" Configuration="Debug" Class="ProjectOutput">
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<RemoteName>UsingServerInDLL.exe</RemoteName>
|
<RemoteName>UsingServerInDLL.exe</RemoteName>
|
||||||
<Overwrite>true</Overwrite>
|
<Overwrite>true</Overwrite>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployFile>
|
</DeployFile>
|
||||||
|
<DeployFile LocalName="Win32\Debug\UsingServerInDLL.exe" Configuration="Debug" Class="ProjectOutput"/>
|
||||||
<DeployClass Name="AdditionalDebugSymbols">
|
<DeployClass Name="AdditionalDebugSymbols">
|
||||||
<Platform Name="iOSSimulator">
|
<Platform Name="iOSSimulator">
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
@ -151,6 +151,16 @@
|
|||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidClasses">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>classes</RemoteDir>
|
||||||
|
<Operation>64</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Android64">
|
||||||
|
<RemoteDir>classes</RemoteDir>
|
||||||
|
<Operation>64</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
<DeployClass Name="AndroidClassesDexFile">
|
<DeployClass Name="AndroidClassesDexFile">
|
||||||
<Platform Name="Android">
|
<Platform Name="Android">
|
||||||
<RemoteDir>classes</RemoteDir>
|
<RemoteDir>classes</RemoteDir>
|
||||||
@ -279,6 +289,16 @@
|
|||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon192">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Android64">
|
||||||
|
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
<DeployClass Name="Android_LauncherIcon36">
|
<DeployClass Name="Android_LauncherIcon36">
|
||||||
<Platform Name="Android">
|
<Platform Name="Android">
|
||||||
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||||
@ -442,6 +462,11 @@
|
|||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
<Extensions>.framework</Extensions>
|
<Extensions>.framework</Extensions>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.framework</Extensions>
|
||||||
|
</Platform>
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
@ -469,6 +494,11 @@
|
|||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
<Extensions>.dylib</Extensions>
|
<Extensions>.dylib</Extensions>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
<Extensions>.dll;.bpl</Extensions>
|
<Extensions>.dll;.bpl</Extensions>
|
||||||
@ -497,6 +527,11 @@
|
|||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
<Extensions>.dylib</Extensions>
|
<Extensions>.dylib</Extensions>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
<Extensions>.bpl</Extensions>
|
<Extensions>.bpl</Extensions>
|
||||||
@ -526,6 +561,10 @@
|
|||||||
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
@ -1107,6 +1146,10 @@
|
|||||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
<DeployClass Name="ProjectOSXEntitlements">
|
<DeployClass Name="ProjectOSXEntitlements">
|
||||||
<Platform Name="OSX32">
|
<Platform Name="OSX32">
|
||||||
@ -1117,6 +1160,10 @@
|
|||||||
<RemoteDir>..\</RemoteDir>
|
<RemoteDir>..\</RemoteDir>
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
<DeployClass Name="ProjectOSXInfoPList">
|
<DeployClass Name="ProjectOSXInfoPList">
|
||||||
<Platform Name="OSX32">
|
<Platform Name="OSX32">
|
||||||
@ -1127,6 +1174,10 @@
|
|||||||
<RemoteDir>Contents</RemoteDir>
|
<RemoteDir>Contents</RemoteDir>
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
<DeployClass Name="ProjectOSXResource">
|
<DeployClass Name="ProjectOSXResource">
|
||||||
<Platform Name="OSX32">
|
<Platform Name="OSX32">
|
||||||
@ -1137,6 +1188,10 @@
|
|||||||
<RemoteDir>Contents\Resources</RemoteDir>
|
<RemoteDir>Contents\Resources</RemoteDir>
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\Resources</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
<DeployClass Required="true" Name="ProjectOutput">
|
<DeployClass Required="true" Name="ProjectOutput">
|
||||||
<Platform Name="Android">
|
<Platform Name="Android">
|
||||||
@ -1167,6 +1222,10 @@
|
|||||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
|
<Platform Name="OSXARM64">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
<Platform Name="Win32">
|
<Platform Name="Win32">
|
||||||
<Operation>0</Operation>
|
<Operation>0</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
@ -1205,16 +1264,17 @@
|
|||||||
<Operation>1</Operation>
|
<Operation>1</Operation>
|
||||||
</Platform>
|
</Platform>
|
||||||
</DeployClass>
|
</DeployClass>
|
||||||
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
||||||
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
|
||||||
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
||||||
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
||||||
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
||||||
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
|
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
|
||||||
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
|
||||||
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
|
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
|
||||||
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
|
||||||
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
|
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
||||||
</Deployment>
|
</Deployment>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform value="Win32">True</Platform>
|
<Platform value="Win32">True</Platform>
|
||||||
|
@ -63,8 +63,8 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
TRQLFirebirdCompiler = class(TRQLCompiler)
|
TRQLFirebirdCompiler = class(TRQLCompiler)
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
function GetLiteralBoolean(const Value: Boolean): String; virtual;
|
||||||
function RQLFilterToSQL(const aRQLFIlter: TRQLFilter): string; virtual;
|
function RQLFilterToSQL(const aRQLFIlter: TRQLFilter): string; virtual;
|
||||||
function RQLSortToSQL(const aRQLSort: TRQLSort): string; virtual;
|
function RQLSortToSQL(const aRQLSort: TRQLSort): string; virtual;
|
||||||
function RQLLimitToSQL(const aRQLLimit: TRQLLimit): string; virtual;
|
function RQLLimitToSQL(const aRQLLimit: TRQLLimit): string; virtual;
|
||||||
@ -93,6 +93,15 @@ begin
|
|||||||
Result := inherited;
|
Result := inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRQLFirebirdCompiler.GetLiteralBoolean(const Value: Boolean): String;
|
||||||
|
begin
|
||||||
|
if Value then
|
||||||
|
begin
|
||||||
|
Exit('true');
|
||||||
|
end;
|
||||||
|
Exit('false');
|
||||||
|
end;
|
||||||
|
|
||||||
function TRQLFirebirdCompiler.RQLCustom2SQL(
|
function TRQLFirebirdCompiler.RQLCustom2SQL(
|
||||||
const aRQLCustom: TRQLCustom): string;
|
const aRQLCustom: TRQLCustom): string;
|
||||||
begin
|
begin
|
||||||
@ -129,9 +138,9 @@ begin
|
|||||||
else if aRQLFIlter.RightValueType = vtBoolean then
|
else if aRQLFIlter.RightValueType = vtBoolean then
|
||||||
begin
|
begin
|
||||||
if SameText(aRQLFIlter.OpRight, 'true') then
|
if SameText(aRQLFIlter.OpRight, 'true') then
|
||||||
lValue := '1'
|
lValue := GetLiteralBoolean(true)
|
||||||
else
|
else
|
||||||
lValue := '0';
|
lValue := GetLiteralBoolean(false);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lValue := aRQLFIlter.OpRight;
|
lValue := aRQLFIlter.OpRight;
|
||||||
|
@ -27,11 +27,14 @@ unit MVCFramework.RQL.AST2InterbaseSQL;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
System.Generics.Defaults,
|
||||||
MVCFramework.RQL.Parser,
|
MVCFramework.RQL.Parser,
|
||||||
MVCFramework.RQL.AST2FirebirdSQL;
|
MVCFramework.RQL.AST2FirebirdSQL;
|
||||||
|
|
||||||
type
|
type
|
||||||
TRQLInterbaseCompiler = class(TRQLFirebirdCompiler)
|
TRQLInterbaseCompiler = class(TRQLFirebirdCompiler)
|
||||||
|
protected
|
||||||
|
function GetLiteralBoolean(const Value: Boolean): String; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -40,6 +43,17 @@ uses
|
|||||||
System.SysUtils,
|
System.SysUtils,
|
||||||
MVCFramework.ActiveRecord;
|
MVCFramework.ActiveRecord;
|
||||||
|
|
||||||
|
{ TRQLInterbaseCompiler }
|
||||||
|
|
||||||
|
function TRQLInterbaseCompiler.GetLiteralBoolean(const Value: Boolean): String;
|
||||||
|
begin
|
||||||
|
if Value then
|
||||||
|
begin
|
||||||
|
Exit('1');
|
||||||
|
end;
|
||||||
|
Exit('0');
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
TRQLCompilerRegistry.Instance.RegisterCompiler('interbase', TRQLInterbaseCompiler);
|
TRQLCompilerRegistry.Instance.RegisterCompiler('interbase', TRQLInterbaseCompiler);
|
||||||
|
@ -84,8 +84,17 @@ var
|
|||||||
begin
|
begin
|
||||||
if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
|
if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
|
||||||
lValue := aRQLFIlter.OpRight.QuotedString('''')
|
lValue := aRQLFIlter.OpRight.QuotedString('''')
|
||||||
|
else if aRQLFIlter.RightValueType = vtBoolean then
|
||||||
|
begin
|
||||||
|
if SameText(aRQLFIlter.OpRight, 'true') then
|
||||||
|
lValue := '1'
|
||||||
|
else
|
||||||
|
lValue := '0';
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
lValue := aRQLFIlter.OpRight;
|
lValue := aRQLFIlter.OpRight;
|
||||||
|
end;
|
||||||
|
|
||||||
lDBFieldName := GetDatabaseFieldName(aRQLFIlter.OpLeft, True);
|
lDBFieldName := GetDatabaseFieldName(aRQLFIlter.OpLeft, True);
|
||||||
|
|
||||||
|
@ -1099,7 +1099,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
ftInteger, ftSmallint, ftShortint, ftByte:
|
ftInteger, ftSmallint, ftShortint, ftByte:
|
||||||
begin
|
begin
|
||||||
aRTTIField.SetValue(AObject, AField.AsInteger);
|
// sqlite doesn't support boolean, so are identified as integers
|
||||||
|
// so we need to do some more checks...
|
||||||
|
if (aRTTIField.FieldType.TypeKind = tkEnumeration) and (aRTTIField.Name.ToLower.Contains('bool')) then
|
||||||
|
begin
|
||||||
|
aRTTIField.SetValue(AObject, AField.AsInteger = 1);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
aRTTIField.SetValue(AObject, AField.AsInteger);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
ftLongWord, ftWord:
|
ftLongWord, ftWord:
|
||||||
begin
|
begin
|
||||||
|
@ -72,6 +72,8 @@ type
|
|||||||
[Test]
|
[Test]
|
||||||
procedure TestRQL;
|
procedure TestRQL;
|
||||||
[Test]
|
[Test]
|
||||||
|
procedure TestRQLWithBoolean;
|
||||||
|
[Test]
|
||||||
procedure TestRQLWithDateTime;
|
procedure TestRQLWithDateTime;
|
||||||
[Test]
|
[Test]
|
||||||
procedure TestRQLLimit;
|
procedure TestRQLLimit;
|
||||||
@ -1453,6 +1455,54 @@ begin
|
|||||||
Assert.AreEqual(Int64(0), TMVCActiveRecord.Count<TCustomer>(RQL1));
|
Assert.AreEqual(Int64(0), TMVCActiveRecord.Count<TCustomer>(RQL1));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestActiveRecordBase.TestRQLWithBoolean;
|
||||||
|
const
|
||||||
|
RQL1 = 'or(eq(City, "Rome"),eq(City, "London"))';
|
||||||
|
var
|
||||||
|
lBoolTable, lBoolValue2: TBoolTest;
|
||||||
|
begin
|
||||||
|
TMVCActiveRecord.DeleteAll(TBoolTest);
|
||||||
|
Assert.AreEqual(Int64(0), TMVCActiveRecord.Count(TBoolTest));
|
||||||
|
lBoolTable := TBoolTest.Create;
|
||||||
|
try
|
||||||
|
lBoolTable.BoolValue := True;
|
||||||
|
lBoolTable.Store;
|
||||||
|
lBoolValue2 := TMVCActiveRecord.SelectOneByRQL<TBoolTest>('eq(boolvalue, true)');
|
||||||
|
try
|
||||||
|
Assert.AreEqual(True, lBoolValue2.BoolValue);
|
||||||
|
finally
|
||||||
|
lBoolValue2.Free;
|
||||||
|
end;
|
||||||
|
lBoolTable.BoolValue := False;
|
||||||
|
lBoolTable.Store;
|
||||||
|
|
||||||
|
lBoolValue2 := TMVCActiveRecord.SelectOneByRQL<TBoolTest>('eq(boolvalue, false)');
|
||||||
|
try
|
||||||
|
Assert.AreEqual(False, lBoolValue2.BoolValue);
|
||||||
|
finally
|
||||||
|
lBoolValue2.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Assert.IsNull(TMVCActiveRecord.SelectOneByRQL<TBoolTest>('eq(boolvalue, true)', False));
|
||||||
|
finally
|
||||||
|
lBoolTable.Free;
|
||||||
|
end;
|
||||||
|
// LoadData;
|
||||||
|
// lCustomers := TMVCActiveRecord.SelectRQL<TCustomer>(RQL1, MAXINT);
|
||||||
|
// try
|
||||||
|
// Assert.AreEqual(240, lCustomers.Count);
|
||||||
|
// for var lCustomer in lCustomers do
|
||||||
|
// begin
|
||||||
|
// Assert.IsMatch('^(Rome|London)$', lCustomer.City);
|
||||||
|
// end;
|
||||||
|
// finally
|
||||||
|
// lCustomers.Free;
|
||||||
|
// end;
|
||||||
|
// TMVCActiveRecord.DeleteRQL(TCustomer, RQL1);
|
||||||
|
// Assert.AreEqual(Int64(0), TMVCActiveRecord.Count<TCustomer>(RQL1));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TTestActiveRecordBase.TestRQLLimit;
|
procedure TTestActiveRecordBase.TestRQLLimit;
|
||||||
var
|
var
|
||||||
lCustomers: TObjectList<TCustomer>;
|
lCustomers: TObjectList<TCustomer>;
|
||||||
|
@ -35,7 +35,7 @@ uses
|
|||||||
FireDAC.Stan.Param, Data.DB, System.SysUtils;
|
FireDAC.Stan.Param, Data.DB, System.SysUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
SQLs_SQLITE: array [0 .. 4] of string =
|
SQLs_SQLITE: array [0 .. 5] of string =
|
||||||
('CREATE TABLE customers (id INTEGER NOT NULL, code varchar (20), description varchar (200), city varchar (200), note TEXT, rating INTEGER, creation_time TIME, creation_date date, PRIMARY KEY (id))',
|
('CREATE TABLE customers (id INTEGER NOT NULL, code varchar (20), description varchar (200), city varchar (200), note TEXT, rating INTEGER, creation_time TIME, creation_date date, PRIMARY KEY (id))',
|
||||||
'CREATE TABLE customers2 (id INTEGER NOT NULL, code varchar (20), description varchar (200), city varchar (200), note TEXT, rating INTEGER, creation_time TIME, creation_date date, PRIMARY KEY (id))',
|
'CREATE TABLE customers2 (id INTEGER NOT NULL, code varchar (20), description varchar (200), city varchar (200), note TEXT, rating INTEGER, creation_time TIME, creation_date date, PRIMARY KEY (id))',
|
||||||
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note TEXT, rating INTEGER, PRIMARY KEY(code))',
|
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note TEXT, rating INTEGER, PRIMARY KEY(code))',
|
||||||
@ -51,10 +51,11 @@ const
|
|||||||
'"rating with spaces" INTEGER, ' +
|
'"rating with spaces" INTEGER, ' +
|
||||||
'"creation_time with spaces" TEXT, ' +
|
'"creation_time with spaces" TEXT, ' +
|
||||||
'"creation_date with spaces" TEXT' +
|
'"creation_date with spaces" TEXT' +
|
||||||
') '
|
') ',
|
||||||
|
'CREATE TABLE booltest(id integer primary key AUTOINCREMENT, boolvalue integer)'
|
||||||
);
|
);
|
||||||
|
|
||||||
SQLs_FIREBIRD: array [0 .. 4] of string =
|
SQLs_FIREBIRD: array [0 .. 5] of string =
|
||||||
('CREATE TABLE customers (id integer generated by default as identity primary key, code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
('CREATE TABLE customers (id integer generated by default as identity primary key, code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
||||||
'CREATE TABLE customers2 (id integer generated by default as identity primary key,code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
'CREATE TABLE customers2 (id integer generated by default as identity primary key,code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
||||||
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note varchar(200), rating INTEGER, PRIMARY KEY(code))',
|
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note varchar(200), rating INTEGER, PRIMARY KEY(code))',
|
||||||
@ -70,10 +71,11 @@ const
|
|||||||
'"rating with spaces" INTEGER, ' +
|
'"rating with spaces" INTEGER, ' +
|
||||||
'"creation_time with spaces" time, ' +
|
'"creation_time with spaces" time, ' +
|
||||||
'"creation_date with spaces" date' +
|
'"creation_date with spaces" date' +
|
||||||
') '
|
') ',
|
||||||
|
'CREATE TABLE booltest(id integer generated by default as identity primary key, boolvalue boolean)'
|
||||||
);
|
);
|
||||||
|
|
||||||
SQLs_POSTGRESQL: array [0 .. 4] of string =
|
SQLs_POSTGRESQL: array [0 .. 5] of string =
|
||||||
('CREATE TABLE customers (id integer generated by default as identity primary key, code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
('CREATE TABLE customers (id integer generated by default as identity primary key, code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
||||||
'CREATE TABLE customers2 (id integer generated by default as identity primary key,code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
'CREATE TABLE customers2 (id integer generated by default as identity primary key,code varchar (20), description varchar (200), city varchar (200), note varchar(200), rating INTEGER, creation_time TIME, creation_date date)',
|
||||||
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note varchar(200), rating INTEGER, PRIMARY KEY(code))',
|
'CREATE TABLE customers_with_code (code varchar (20) not null, description varchar (200), city varchar (200), note varchar(200), rating INTEGER, PRIMARY KEY(code))',
|
||||||
@ -89,7 +91,8 @@ const
|
|||||||
'"rating with spaces" int4 NULL, ' +
|
'"rating with spaces" int4 NULL, ' +
|
||||||
'"creation_time with spaces" time NULL, ' +
|
'"creation_time with spaces" time NULL, ' +
|
||||||
'"creation_date with spaces" date NULL' +
|
'"creation_date with spaces" date NULL' +
|
||||||
')'
|
')',
|
||||||
|
'CREATE TABLE booltest(id integer generated by default as identity primary key, boolvalue boolean)'
|
||||||
);
|
);
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -352,6 +355,20 @@ type
|
|||||||
property f_blob: TStream read ff_blob write ff_blob;
|
property f_blob: TStream read ff_blob write ff_blob;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
[MVCTable('booltest')]
|
||||||
|
TBoolTest = class(TMVCActiveRecord)
|
||||||
|
private
|
||||||
|
[MVCTableField('id', [foPrimaryKey, foAutoGenerated])]
|
||||||
|
fID: NullableInt32;
|
||||||
|
[MVCTableField('boolvalue')]
|
||||||
|
fBoolValue: Boolean;
|
||||||
|
public
|
||||||
|
property ID: NullableInt32 read FID write fID;
|
||||||
|
property BoolValue: Boolean read FBoolValue write fBoolValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
TMyObject = class
|
TMyObject = class
|
||||||
private
|
private
|
||||||
FPropString: string;
|
FPropString: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user