Package com.jk.webstack.rest
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
ConstructorsConstructorDescriptionThis method constructs a newJKMatureJpaRestService
. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
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
This method finds an object from the data storage using its identifier (ID).jakarta.ws.rs.core.Response
This method updates an existing object in the data storage.
-
Constructor Details
-
JKMatureJpaRestService
public JKMatureJpaRestService()This method constructs a newJKMatureJpaRestService
.
-
-
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
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
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
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
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.
-