#1 2016-12-20 16:21:48

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

How do I initialize new object with values from server, the ORM way?

Hi,

I am trying to figure out how to create a new object in the client with values initialized from the server.
Some help much appreciated.

Merci!

Last edited by wai-kit (2016-12-20 16:30:44)


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

#2 2016-12-20 18:26:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: How do I initialize new object with values from server, the ORM way?

Values are expected to be created on the client, and then sent to the server for persistence.
Default values can be set by overriding the TSQLRecord.Create constructor, but it is not server-side, it is for both sides.
But there is no direct way of doing what you expect, i.e. fill the value from the server.

I guess a method-based  or interface-based service which may be defined to fill your TSQLRecord from the server side.

Offline

Board footer

Powered by FluxBB