Entity Service

In the context of Dirigible, the Entity Service means a REST service which exposes the CRUD methods on top of the database table. The following steps shows how to generate such an entity service on top of existing table.

Version 2.x

Develop

Select the ScriptingServices sub-folder of the project and open the pop-up menu.

From the menu, choose New -> Scripting Service.

From the wizard, select Entity Service on Table from the list of available templates.

Click Next.

From the list of all available tables, select the one that will be used to generate the entity service and click Next.

Enter the name of your entity service and click Finish.

The generated service will be opened in the editor.

Now, you can use the Publish action from the project’s pop-up menu to enable the service.

Go to Workspace Explorer where the project is managed and select the service artifact (books.js). This action will make a GET HTTP request to the service and the response from the service can be seen the Preview view.

There are some specific requirements for the table to be exposed as an entity service (e.g. primary key has to be defined, it should be a single column, etc.). Also, the entity service itself supports a bit more operations than the standard ones defined by HTTP. For more information, see Entity Service.