#1 2016-08-04 14:16:54

mauriciobs
Member
From: Brazil
Registered: 2016-05-11
Posts: 16

CreateJoined generates an "Access violation"

Hi all,
I create these two classes:

  TSQLAuthUsuario = class(TSQLAuthUser)
  private
    femail: RawUTF8;
    fativo: boolean;
  public
    class procedure InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8;
      Options: TSQLInitializeTableOptions); override;
    class procedure InternalDefineModel(Props: TSQLRecordProperties); override;
    constructor Create; override;
    destructor Destroy; override;
  published
    property email: RawUTF8 read femail write femail;
    property ativo: boolean read fativo write fativo;
  end;

  TSQLAuthGrupo = class(TSQLAuthGroup)
  private
    fServicoBloqueado: variant;
    fMenuAtivo: variant;
  public
    class procedure InitializeTable(Server: TSQLRestServer; const FieldName: RawUTF8;
      Options: TSQLInitializeTableOptions); override;
    class procedure InternalDefineModel(Props: TSQLRecordProperties); override;
    constructor Create; override;
    destructor Destroy; override;
  published
    property MenuAtivo: variant read fMenuAtivo write fMenuAtivo;
  end;

When I run the following code the error occurs:

  SQLAuthUsuario := TSQLAuthUsuario.CreateJoined(RestModel, 1);
  Writeln(#10 + SQLAuthUsuario.grouprights.Ident + #10);

If I use the primary classes TSQLAuthUser and TSQLAuthGroup works without error.

Last edited by mauriciobs (2016-08-04 14:18:48)

Offline

Board footer

Powered by FluxBB