#1 Re: mORMot 1 » One to one relationship » 2013-02-04 15:20:00

Can you show a example? It's a property, I can't override it.

#2 Re: mORMot 1 » One to one relationship » 2013-02-04 11:30:13

Is there a method that is called after a record be Updated?

#3 Re: mORMot 1 » One to one relationship » 2013-02-02 20:46:10

ab wrote:

ask for a copied/sharded property name of a detail record to be automatically updated if the main property name is changed.

How can I do it? Is there a command to do it, like a trigger, every time some user alters the unit table the UnitName in the product table is updated?

#4 mORMot 1 » One to one relationship » 2013-02-02 19:36:42

TommyYommi
Replies: 7

Hello,

I have 2 tables, on the first table I have a Integer field that relates with the second table. I need that the ORM goto the second table get a text field( of the corresponding row that indicates on the ID of the first table) and show togheter in the same select (same TSQLRecord).

A example of what I'm talking about:

  TUnit = class(TSQLRecord)
  private
    FName: RawUTF8;
  published
    property Name: RawUTF8 read FName write FName;
  end;


  TProduct = class(TSQLRecord)
  private
        ....
    FIDUnit: TUnit;
  published
       ....
    property IDUnit: TUnit read FIDUnit write FIDUnit;
  end;

In this case when I retrieve a TProduct the TUnit.Name has to come together with this record. How should I proceed?

#5 Re: mORMot 1 » Foreign Key in SQlite and ORM » 2013-02-02 17:37:37

I believe that when you declare a class with a relationship (TSQLRecord kind of field), the should create the correspondent Foreign key, there would be a default option (cascade or restricted).

What do you think?

#6 Re: mORMot 1 » Foreign Key in SQlite and ORM » 2013-02-02 15:51:28

Very well, thanks for all the answers.

I will use TSQLRecord.InitializeTable() method.

#7 Re: mORMot 1 » Foreign Key in SQlite and ORM » 2013-02-02 15:35:41

I need to create the Foreign Keys by hand.

Is there a command on the ORM to create Foreign Keys?
If not, Wich Administration tool to SQlite you think is better to the Database created by the ORM, for me to do that?

#8 Re: mORMot 1 » Foreign Key in SQlite and ORM » 2013-02-02 15:26:17

Internal how? If I try to delete a record used by another table the ORM won't  let me?

#9 mORMot 1 » Collation List SQlite » 2013-02-02 10:32:16

TommyYommi
Replies: 4

Hi...

I was seen the Database created by the ORM, and in the Database Properties -> Collation List there is a [SYSTEMNOCASE] as one of its values.

What does  [SYSTEMNOCASE] means?

#10 mORMot 1 » Foreign Key in SQlite and ORM » 2013-02-02 10:19:27

TommyYommi
Replies: 8

Hello...


How can I declare a TSQLRecord in a way to make the ORM create a Foreign Key into a SQlite database?

I have declare 2 classes:

  TEndereco = class(TSQLRecord)
  private
    FLogradouro: RawUTF8;
    FBairro: RawUTF8;
    FNumero: Integer;
    FCidade: RawUTF8;
  published
    property Logradouro: RawUTF8 read FLogradouro write FLogradouro;
    property Numero: Integer read FNumero write FNumero;
    property Bairro: RawUTF8 read FBairro write FBairro;
    property Cidade: RawUTF8 read FCidade write FCidade;
  end;

  TCliente = class(TSQLRecord)
  private
    FDivida: Currency;
    FDataAlteracao: TModTime;
    FIdade: Integer;
    FNome: RawUTF8;
    FDataNascimento: TDateTime;
    FCNPJ: RawUTF8;
    FEndereco: TEndereco;
  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;
  end;

The ORM created 2 tables and a Endereco Integer field to make the relationship, but do not create a Foreign Key between the 2 tables.

#11 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-30 16:12:03

Perfect, I'm will wait for it.
It would very nice if you developed a example using this unit, when you release SynDBFirebird.pas.

What do you think? big_smile

#12 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-30 14:04:12

Ok, do you think until June/2013 this unit will be work fine?

#13 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-30 12:58:14

I downloaded the last version, but the problem persist.

What does CreateMissingTables do?

On the Firebird database already exists a table CLIENT that I created and insert some records in it.I'm just trying to acess this Table and retrive one of those records.

#14 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-30 10:39:03

Ok, I add the code

Server.CreateMissingTables(0);

It says the table already exists.  What can be the cause of this error?

#15 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-29 22:39:31

I'm trying to emulate it, but some how doesn't work.

var
  Props: TSQLDBFirebirdConnectionClientProperties;
  Server : TSQLRestServerDB;
  Cli : TClient;
  CliModel : TSQLModel;
  Client : TSQLRestClientDB;
begin
  Props := TSQLDBFirebirdConnectionClientProperties.Create('localhost:X:\MORMOT\ORM\TEST.fdb', 'TEST.fdb', 'SYSDBA', 'masterkey');
  CliModel := TSQLModel.Create([TCliente], 'root');
  VirtualTableExternalRegister(CliModel, TClient, Props, 'CLIENT');
  Server := TSQLRestServerDB.Create(CliModel, 'application.db');
  Cli :=TClient.CreateAndFillPrepare(Server, 'ID=?', [1]);

It says theres no such table, but in the database the table is all normal. What am I doing wrong?

#16 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-29 17:12:08

Where in the SAD documentation can I find It? Is there any example for guide me?

#17 Re: mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-29 16:41:56

OK, but how can I acess Fiberbird withou using TSQLDBStatement / TSQLDBConnection, and only using TSQLRestServerDB?

#18 mORMot 1 » Newbie question. TSQLRecord and Database acess. » 2013-01-29 14:41:08

TommyYommi
Replies: 15

Hi,

I'm new with your ORM, while reading the SAD documentation. I don't understand how to get a TSQLRecord.CreateAndFillPrepare.

Connect to the database and use a TSQLDBStatement is all right.
But what class do I have to use to connect into the TSQLDBConnection and the TSQLRecord(if that is possible)?
How can I retrieve a record from the database to a TSQLRecord inherited class? Do I have to use TSQLRestServerDB?

#20 mORMot 1 » Change Security in TSQLRestServerFullMemory » 2013-01-26 18:10:26

TommyYommi
Replies: 2

Hi,

How can I change the User and Password for connect into the server?  I'm using TSQLRestServerFullMemory in Interfaced Based Services, and for all I know
the user table stay in memory, right? How can add and remove users ?

#21 mORMot 1 » Too Many Fields » 2013-01-26 14:12:15

TommyYommi
Replies: 2

Hi, I have a class with 71 propertys and fields.

I'm getting this error : "TPerson has too many fields".

Why there is a field quantity limitation? How can I handle It?

#22 Re: mORMot 1 » TObjectList » 2013-01-25 09:38:27

Hi,

AB, How many objects do you recomend to send using one TObjectList??

#23 mORMot 1 » dwsDatabase » 2013-01-24 16:16:44

TommyYommi
Replies: 1

I would like to know what you guys think about dwsDatabase?
http://delphitools.info/2013/01/23/intr … sdatabase/

It says that works with  mORMot SynDB and Universal InterBase.

#24 Re: mORMot 1 » ClientDataSet » 2013-01-22 13:42:19

Does It woks with Interfaced Based Services and TObjectList?

#25 mORMot 1 » ClientDataSet » 2013-01-22 11:03:17

TommyYommi
Replies: 3

Hi, is there a away to turn a class retrieved from the database into a record on a ClientDataSet?

#26 Re: mORMot 1 » Connect Firebird » 2013-01-20 16:17:08

Good!!!

I'm will wait for it.

#27 mORMot 1 » Connect Firebird » 2013-01-20 12:30:26

TommyYommi
Replies: 6

Hello,

Is there a way to use dbexpress or devart to connect into a database and still use your ORM?
If no, how can I acess a Firebird database other than ODBC?

Board footer

Powered by FluxBB