we are looking for some ORM framework and we are considering to use EntityDAC. So I downloaded and installed the trial version to test some features. I wrote a very simple example:
Code: Select all
unit entityDACtest;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
EntityDAC.Entity,
EntityDAC.EntityConnection,
EntityDAC.EntityAttributes,
EntityDAC.EntityContext,
EntityDAC.DataProvider.FireDAC,
EntityDAC.MetaEntity,
EntityDAC.NullableTypes,
EntityDAC.Types,
EntityDAC.Utils,
FireDAC.Stan.Def,
FireDAC.Phys.MSSQL,
FireDAC.DApt,
FireDAC.VCLUI.Wait,
FireDAC.Stan.Async;
type
[Table('dbo.GTW_WORKFLOWS')]
[Model('WorkflowModel')]
[Key('FWorkflowid')]
TGTWWorkflow = class(TMappedEntity)
private
[Column('workflowid')]
FWorkflowid: Integer;
[Column('typeid')]
FTypeid: Integer;
[Column('WF_name', 255, [CanBeNull])]
FWfName: String;
end;
TForm1 = class(TForm)
procedure onCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.onCreate(Sender: TObject);
var
Lconnection: TEntityConnection;
Lcontext: TEntityContext;
Lworkflows: IEntityEnumerable<TGTWWorkflow>;
Lworkflow : TGTWWorkflow;
begin
Lconnection := TEntityConnection.Create;
Lconnection.ProviderName := 'FireDAC';
Lconnection.DialectName := 'SQL Server';
Lconnection.ConnectionString := 'Data Provider=FireDAC;SQL Dialect=SQL Server;Login Prompt=False;DriverID=MSSQL;Server=127.0.0.1;Database=GTWtest;User_name=sa;Password=*********';
Lconnection.Connect;
Lcontext := TEntityContext.Create;
Lcontext.Connection := Lconnection;
Lcontext.ModelName := 'WorkflowModel';
Lworkflows := Lcontext.GetEntities<TGTWWorkflow>;
for Lworkflow in Lworkflows do
begin
ShowMessage(Lworkflow.FWfName);
end;
end;
initialization
ForceRtti(TGTWWorkflow);
end.
---------------------------
Debugger Exception Notification
---------------------------
Project entityDACproj.exe raised exception class EAssertionFailed with message 'Assertion failure (D:\Projects\Delphi\EntityDac\Source\EntityDAC.Entity.pas, line 319)'.
---------------------------
Break Continue Help
---------------------------
I'm a bit confused since there is no such path in my computer (there is not a drive D).
Can you please give me a way how to repair this example to working state?
Lot of thanks.