Class JKMatureJpaRestService<T extends JKBaseEntity>

java.lang.Object
com.jk.webstack.rest.JKMatureJpaRestService<T>
Type Parameters:
T - Specifies the type of JPA entity managed by this service, which should extend JKBaseEntity.

@Consumes("application/json") @Produces("application/json") public class JKMatureJpaRestService<T extends JKBaseEntity> extends Object
This class is a JAX-RS REST service designed for interacting with JPA entities that extend the JKBaseEntity class.

It provides standard CRUD (Create, Read, Update, Delete) operations for managing instances of these entities.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Summary

    Constructors
    Constructor
    Description
    This method constructs a new JKMatureJpaRestService.
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    add(T stack)
    This method inserts the provided object into the data storage.
    jakarta.ws.rs.core.Response
    This method deletes an object from the data storage using its identifier(ID).
    jakarta.ws.rs.core.Response
    get()
    This method retrieves a list of objects of the generic class type which is associated with this service from the data storage.
    jakarta.ws.rs.core.Response
    get(String id)
    This method finds an object from the data storage using its identifier (ID).
    jakarta.ws.rs.core.Response
    update(String id, T stack)
    This method updates an existing object in the data storage.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JKMatureJpaRestService

      public JKMatureJpaRestService()
      This method constructs a new JKMatureJpaRestService.
  • Method Details

    • get

      @GET public jakarta.ws.rs.core.Response get()
      This method retrieves a list of objects of the generic class type which is associated with this service from the data storage.
      Returns:
      the response containing list of objects from data storage that are of the associated class type.
    • get

      @GET @Path("/{id}") public jakarta.ws.rs.core.Response get(@PathParam("id") String id)
      This method finds an object from the data storage using its identifier (ID).
      Parameters:
      id - Specifies the identifier (ID) of the object to find.
      Returns:
      the Response containing the entity in JSON format, or a 404 response if not found.
    • add

      @POST public jakarta.ws.rs.core.Response add(T stack)
      This method inserts the provided object into the data storage.
      Parameters:
      stack - Specifies the type of the object.
      Returns:
      the Response containing the added entity in JSON format.
    • update

      @PUT @Path("/{id}") public jakarta.ws.rs.core.Response update(@PathParam("id") String id, T stack)
      This method updates an existing object in the data storage.
      Parameters:
      id - Specifies the identifier (ID) of the object to update.
      stack - Specifies the object to update.
      Returns:
      the Response containing the updated entity in JSON format.
    • delete

      @DELETE @Path("/{id}") public jakarta.ws.rs.core.Response delete(@PathParam("id") String id)
      This method deletes an object from the data storage using its identifier(ID).
      Parameters:
      id - Specifies the object identifier (ID).
      Returns:
      the Response indicating success (201) or a 404 response if not found.