Send Criteria to server


Is it possible to send a TCriteria to the server from client using Rest?
Do you have an interface for TCriteria (ICriteria)?

Christophe Ravaut

Actually if you use the query options in an entity set ($filter, $skip, $top), it behaves more or less like "sending a criteria". Isn't it enough for what you need?

Hello Wagner,

On the client site I must send to the server some parameters.


  1. Which database connection
  2. List of Alias for  TFetchMode.Eager
  3. list of filters

With these three parameters can I chose the database, force the lazy-loading with eager mode and make my selection.

I'm using the datasnap on the server end TDSRestConnection on the client.

I was thinking to use the TCriteria but I must have a TObjectManager. The TCriteria can do the last 2 params

But I do not use a TObjectManager on the client site, I use the servermethode with DSRestConnection

I did not test the datax or dbremote.

  1. You should create different XData modules for different database connections. XData module handles the connection pool for you, so you cannot mix the connections. Recommendation is to use a different URL for each db connection

    2. You can use $expand query option for that

    3. You can use $filter query option for that

    Ok, I have now read that you are not using XData... Then it's up to you to make a way to serialize the criteria, send it to the other side, and deserialize it. There is no such feature for using it with DataSnap...

Thanks for the information.