Applipress documentation 1.0 Help

Managing Entities through API

The generation of entities in Applipress accomplishes several tasks that pave the way for a robust application architecture. This includes creating:

  • Liquibase scripts for database table creation

  • Test data for the table generated through Faker

  • Corresponding entity classes and endpoints for entity operations

  • OpenAPI definition of entity endpoints

  • Automatically generated test classes for the entity

  • Automatically generated documentation pages for the entity

  • Angular service for managing the entity through the API

  • Automatically generated test classes for the Angular service

app_generated_entity_source.png

These components enable efficient and streamlined management of entities within your application. To illustrate, let's explore how to access and manage the 'Customer' entity through the API:

  1. Open the Generated Application: Launch your browser and navigate to the generated application. From the menu, select >Administration >API.

app_administration_api.png
  1. Access the GET /api/customers Endpoint: This endpoint is designed to fetch a list of 'Customer' entities from the database.

  2. Define a pageable Object: To retrieve a specific page of customer records, define the following pageable object in the request parameters:

    { "page": 0, "size": 10, "sort": [ "id" ] }

    This object specifies that you wish to retrieve the first page (page: 0) of customer records, with up to 10 records per page (size: 10), sorted by their id.

app_api_get_customers.png
  1. Execute the Request: Click on 'Execute' to perform the request. You will receive a list of all 'Customer' entities stored in the database, displayed according to the pagination and sorting parameters you defined.

app_api_get_customers_result.png

This process demonstrates the power and flexibility of managing entities via the API in an Applipress-generated application. By leveraging the automatically generated backend infrastructure and frontend services, developers can quickly implement sophisticated data management and retrieval functionalities in their applications.

Last modified: 18 March 2024