PK - the generic type of the primary keyDO - the generic type of the domain objectpublic interface RestfulResource<PK,DO>
RestfulResource provides crud methods| Modifier and Type | Method and Description |
|---|---|
DO |
create(DO domainObject)
Creates an entity from the given domain object and persist it to the underlying database.
|
void |
delete(DO domainObject)
Deletes an entity in the underlying database from the given domain object
|
void |
deleteById(PK id)
Deletes an entity with the given id.
|
void |
merge(DO domainObject)
Updates the given domain object to the underlying database.
|
DO |
readById(PK id)
Read an entity with the given id and maps it to a domain object that will be returned.
|
void |
update(DO domainObject)
Updates the given domain object to the underlying database.
|
@POST @Path(value="/") DO create(DO domainObject)
domainObject - the domain object@DELETE @Path(value="/delete/") void delete(DO domainObject)
domainObject - the domain object to be deleted@DELETE
@Path(value="/{id}")
void deleteById(@PathParam(value="id")
PK id)
id - the id@PATCH @Path(value="/") void merge(DO domainObject)
domainObject - the domain object@GET
@Path(value="/{id}")
DO readById(@PathParam(value="id")
PK id)
id - the id@PUT @Path(value="/") void update(DO domainObject)
domainObject - the domain object