Class EntityResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.entity.spi.entities.AbstractEntityValidationResource
ch.tocco.nice2.rest.entity.impl.resources.entities.AbstractEntityResource
ch.tocco.nice2.rest.entity.impl.resources.entities.EntityResource
- All Implemented Interfaces:
RestResource
@Path("/entities/2.0/{name}/{pk: (?!.*((multi)|(search)|(count)|(model)))[^/]+ }")
public class EntityResource
extends AbstractEntityResource
This resource provides a single entity (a single record).
Resource is mapped to "/entities/{name}/{pk}" ("pk" can be everything except of "multi", "search", "count" and "model",
because there would be a conflict with methods in EntitiesResource
).
-
Field Summary
Fields inherited from class ch.tocco.nice2.rest.entity.impl.resources.entities.AbstractEntityResource
cascadingDeleteService, context, dataModel, entityBeanRebinder
Fields inherited from class ch.tocco.nice2.rest.entity.spi.entities.AbstractEntityValidationResource
validationResultConverter
Fields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo
-
Constructor Summary
ConstructorDescriptionEntityResource
(Context context, RestSearchService restSearchService, EntityBeanRebinder entityBeanRebinder, CascadingDeleteService cascadingDeleteService, DataModel dataModel, ValidationResultConverter validationResultConverter) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
deleteEntity
(String modelName, String pk, @Nullable EntityBean[] excludedBeans) getEntityViaPost
(String modelName, String pk, EntityFetchBean entityFetchBean) jakarta.ws.rs.core.Response
patchEntity
(String modelName, String pk, EntityBean entityBean) Methods inherited from class ch.tocco.nice2.rest.entity.impl.resources.entities.AbstractEntityResource
doDeleteEntity, doUpdateEntity
Methods inherited from class ch.tocco.nice2.rest.entity.spi.entities.AbstractEntityValidationResource
validateEntities, validateEntity
Methods inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Constructor Details
-
EntityResource
public EntityResource(Context context, RestSearchService restSearchService, EntityBeanRebinder entityBeanRebinder, CascadingDeleteService cascadingDeleteService, DataModel dataModel, ValidationResultConverter validationResultConverter)
-
-
Method Details
-
getEntity
@GET @Produces("application/json") public EntityBean getEntity(@PathParam("name") String modelName, @PathParam("pk") String pk) -
getEntityViaPost
@POST @Consumes("application/json") @Produces("application/json") public EntityBean getEntityViaPost(@PathParam("name") String modelName, @PathParam("pk") String pk, EntityFetchBean entityFetchBean) -
patchEntity
@PATCH @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response patchEntity(@PathParam("name") String modelName, @PathParam("pk") String pk, EntityBean entityBean) -
deleteEntity
@DELETE @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response deleteEntity(@PathParam("name") String modelName, @PathParam("pk") String pk, @Nullable @Nullable EntityBean[] excludedBeans)
-