Back & Architecture

Creation of entities and notifications from a JPA model

As we mentioned in this article (in Spanish) of the Developer Portal, we have incorporated a functionality to the Java client library that allows, from a JPA data model, to create and update entities based on this definition, in addition to being able to launch notifications to the Platform in a very simple way.

In this way it is possible to work in a decoupled way with an external database and at the same time to continue using the capabilities of the Platform, since it needs the existence of the entities in the system to work.

In addition, this library is compatible with versions higher than Spring Boot 3.X.

Native Spring Boot annotations

This functionality incorporates the following native Spring Boot annotations:

@OPEntity

At the class level, the JPA Entity serves to identify the JPA entities to be transparently created and updated in the Platform.

@OPValidateSchema

At the method argument level, it is used to verify that the data of an entity corresponds to the JSON schema existing in the platform. Example of use: before an insertion.

@OPNotifierOperation

In this case, this functionality is used as:

@OPNotifierOperation(ontology = "Message", operationType = OperationType.INSERT, async = true)

At the method level, it is used to launch notifications to the Platform and to be able to listen from Flow Engine processes, Business Rules, etc.

Header image: Miltiadis Fragkidis at Unsplash.

✍🏻 Author(s)

Leave a Reply

Your email address will not be published. Required fields are marked *