#2 Re: mORMot 1 » Error on TSQLTableToDataSet » 2013-02-09 11:03:21

Having more time to debug, the type of fields that has this issue are: TEnumeration, TTimeLog and sometimes boolean.

#3 Re: mORMot 1 » Error on TSQLTableToDataSet » 2013-02-08 18:57:37

Ok, what can we do to solve this problem?

I was debuging and seens like the problem is in this line:

else result.Fields[F].AsVariant := aTable.GetVariant(i,F,aClient);

when the framework is populating the clientdataset.

What do you guys think?

#4 Re: mORMot 1 » Error on TSQLTableToDataSet » 2013-02-08 15:58:25

Do you think this problem is happening because of the method TSQLTableToDataSet or the declaration of the class?

#5 Re: mORMot 1 » Error on TSQLTableToDataSet » 2013-02-08 14:24:09

I'm using Delphi XE2 UP4.

The  latest unstable 1.18 version that I'm using is this one: http://synopse.info/fossil/info/9e89095221

The class is:

  TTipoPessoa = (tpJuridica, tpFisica);

  TCliente = class(TSQLVO)
  private
    FDivida: Currency;
    FDataAlteracao: TModTime;
    FIdade: Integer;
    FNome: RawUTF8;
    FDataNascimento: TDateTime;
    FCNPJ: RawUTF8;
    FEndereco: TEndereco;
    FEnderecoLogradouro: RawUTF8;
    Fchk1: Boolean;
    FTipoPessoa: TTipoPessoa;
    FData: TDateTime;
    published
    property Nome: RawUTF8 read FNome write FNome;
    property Idade: Integer read FIdade write FIdade;
    property DataAlteracao: TModTime read FDataAlteracao write FDataAlteracao;
    property Divida: Currency read FDivida write FDivida;
    property DataNascimento: TDateTime read FDataNascimento
      write FDataNascimento;
    property CNPJ: RawUTF8 read FCNPJ write FCNPJ;
    property Endereco: TEndereco read FEndereco write FEndereco;
    property EnderecoLogradouro: RawUTF8 read FEnderecoLogradouro
      write FEnderecoLogradouro;
    property chk1 : Boolean read Fchk1 write Fchk1;
    property TipoPessoa : TTipoPessoa read FTipoPessoa write FTipoPessoa;
  end;

#6 Re: mORMot 1 » Error on TSQLTableToDataSet » 2013-02-08 13:41:12

It is happening with all kind of fields.

#7 mORMot 1 » Error compiling SynCommons » 2013-02-08 11:18:11

arquivo59
Replies: 2

Seens like the new sources is wrong, because I can't compile SynCommons, I'm using delphi xe2.

The error is: "error E2442: E2441 Inline function declared in interface section must not use local symbol 'GetHighUTF8UCS4'"

This is the last version in the TimeLine

#8 mORMot 1 » Error on TSQLTableToDataSet » 2013-02-08 10:26:34

arquivo59
Replies: 9

Hello,

When I try to use the method TSQLTableToDataSet I get the error: "Could not convert variant of type (UnicodeString) into type (Date)".

I'm using the ORM with SQlite.

I have a property BirthDate of type TTimeLog, I suspect that the error is with this TTimeLog type of Field. Because I have fields TModTime and TCreateTime but the error started after I add the BirthDate : TTimeLog.

Is this a error of the framework? How can I handle It properly?

#9 mORMot 1 » Date and Time » 2013-02-07 12:40:55

arquivo59
Replies: 1

Hello,

How can I handle fields of tipe only Date or only Time? I know there's TTimeLog / TModTime / TCreateTime. But can I use TDate and TTime?

#10 mORMot 1 » TModTime to TDateTime » 2013-02-02 12:36:51

arquivo59
Replies: 1

Hi. How can I convert TModTime / TCreateTime into TDatetime to show it to the user?

#11 Re: mORMot 1 » TObjectList » 2013-01-24 20:50:19

Ok, thanks.

I'm having some troubles with this approach. Error : "Class TBankVO" not found".

  
  TBankVO = class(TSQLRecord)  
  private
    FCODIGO: String;
    FNOME: String;

  published
    [TFormatter(100, taCenter, True, True)] // this is a custom attribute
    property Codigo: String read FCODIGO write FCODIGO;
    property Nome: String read FNOME write FNOME;

I have a procedure in a interface:

  IBancoController = interface(IInvokable)
              ['{078EF22D-E687-44AE-8E9F-47C841095108}']
              procedure Get(var Result: TObjectList);
          end; 

When I'm calling from the client a found this error every time.

#12 mORMot 1 » TObjectList » 2013-01-24 17:55:21

arquivo59
Replies: 7

Hi,

Wich TObjectList can I use with Interface Based Services, from the unit WebAdapt or System.Generics.Collections???

#13 Re: mORMot 1 » Object in Interface Based Services » 2013-01-18 16:35:34

Great!!!

There is a code:

 26063      oObjectList: begin // TList leaks memory, but TObjectList uses "ClassName":. 

Does It means that TObjectList don't leaks memory?

#14 Re: mORMot 1 » Change password » 2013-01-17 17:33:36

I'm sorry if I have been annoying, is that I'm accustomed to the Datasnap, and all this is different to me.


I'm suppose to create a model off an TSQLAuthUser and TSQLAuthGroup?

#15 mORMot 1 » Change password » 2013-01-17 13:53:46

arquivo59
Replies: 3

Hello,

In the sample 14 theres a code to set user and password:

 Client.SetUser('User','synopse'); 

How can we change the name of the user and the password of the server?

#16 mORMot 1 » Garbage Collector » 2013-01-17 11:14:56

arquivo59
Replies: 1

There is a Garbage Collector on the framework?

#18 Re: mORMot 1 » Object in Interface Based Services » 2013-01-16 22:54:54

I see you use a class TInterfacedCollection.

I'm beginning with delphi, I read a lot o posts in this forum and in the documentation, but I still don't know how to use it in this situation.

Could give me a example?

Thanks!!

#19 Re: mORMot 1 » Object in Interface Based Services » 2013-01-16 19:55:46

Very well, how can a send a bunch o TCostumers like 30 at once?
Can I send a TList of TCostumers?

#20 Re: mORMot 1 » Object in Interface Based Services » 2013-01-16 17:14:50

OK, could you give a example of how I should do It?

Thanks!!

#21 Re: mORMot 1 » Object in Interface Based Services » 2013-01-16 13:27:07

Thank you for answering.

This is a class I'm using:

  TCostumer = class(TPersistent)
  private
    FName: string;
    published
    property Name : string read FName write FName;
  end; 

This is the interface:

  ICostumer = interface(IInvokable)
    ['{770D009F-15F4-4307-B2AD-BBAE42FE70C0}']
    function GetCostumer : TCostumer;
  end; 

When a try to run the server a get the error: 'ICostumer .GetCostumer: unexpected result type TCostumer'

I didn't found any example sending objects.

#22 mORMot 1 » Object in Interface Based Services » 2013-01-15 21:57:57

arquivo59
Replies: 12

Hi, I'm new with your amazing framework.

How do I send Object from the server to the client in a Interface Based Services?

#23 Re: mORMot 1 » ObjectToJSON » 2013-01-14 22:52:24

Perfect, thank you.

How do I use de function JSONToObject?

JSONToObject(d, Putf8char(mmo1.Lines.Text), b);

d is a TCostumer, mmo1.Lines.Text has the JSON from the result of the earlier procedure, and b is a boolean.

However the code:

mmo1.Lines.Add(d.Name);

Results in a empty string ''.

#24 mORMot 1 » ObjectToJSON » 2013-01-14 21:51:47

arquivo59
Replies: 3

Hi, sorry about my English, I'm from Brazil.

I'm trying to turn a Object into JSON format putting the result into a TMemo. Its a simple class:

  TCostumer = class(TPersistent)
  private
    FName: RawUTF8;
  public
    property Name: RawUTF8 read FName write FName;
  end;

The code I'm using is:

 procedure TForm1.Button1Click(Sender: TObject);
var
  c : TCostumer ;
begin
  c := TCostumer .Create;
  c.Name:= 'Tom';
  Memo1.Lines.Add(ObjectToJSON(c));
end;

The problem is that the result is "{}". What am I doing wrong?

Board footer

Powered by FluxBB