Class EntitiesResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.entity.spi.entities.AbstractEntityValidationResource
ch.tocco.nice2.rest.entity.spi.entities.AbstractEntitiesResource
ch.tocco.nice2.rest.entity.impl.resources.entities.EntitiesResource
- All Implemented Interfaces:
RestResource
This resource provides a collection of the entities of a certain type.
This resource is based on the _path parameter; all paths are selected together in the main query (if possible), which results in much better performance compared to the old version.
-
Nested Class Summary
-
Field Summary
Fields inherited from class ch.tocco.nice2.rest.entity.spi.entities.AbstractEntitiesResource
context, entityBeanRebinder, restSearchService
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
ConstructorDescriptionEntitiesResource
(Context context, EntityBeanRebinder entityBeanRebinder, ValidationResultConverter validationResultConverter, RestSearchService restSearchService) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
addEntities
(String modelName, EntityBean[] entityBeans) jakarta.ws.rs.core.Response
addEntity
(String modelName, EntityBean entityBean) getCount()
jakarta.ws.rs.core.Response
patchEntities
(String modelName, EntityBean[] entityBeans) postCount
(EntitySearchBean searchBean) searchEntities
(String modelName, EntitySearchBean searchBean) Methods inherited from class ch.tocco.nice2.rest.entity.spi.entities.AbstractEntitiesResource
getNameFromPath, getUriBuilder, isValidate, rebind, rebind, rebind, rebind, rebind
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
-
EntitiesResource
public EntitiesResource(Context context, EntityBeanRebinder entityBeanRebinder, ValidationResultConverter validationResultConverter, RestSearchService restSearchService)
-
-
Method Details
-
getEntities
-
searchEntities
@POST @Path("search") @Produces("application/json") @Consumes("application/json") public CollectionBean searchEntities(@PathParam("name") String modelName, EntitySearchBean searchBean) -
addEntity
@POST @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response addEntity(@PathParam("name") String modelName, EntityBean entityBean) -
addEntities
@POST @Path("multi") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response addEntities(@PathParam("name") String modelName, EntityBean[] entityBeans) -
patchEntities
@PATCH @Path("multi") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response patchEntities(@PathParam("name") String modelName, EntityBean[] entityBeans) -
getCount
- Overrides:
getCount
in classAbstractEntitiesResource
-
postCount
@POST @Path("count") @Consumes("application/json") @Produces("application/json") public CountBean postCount(EntitySearchBean searchBean) - Overrides:
postCount
in classAbstractEntitiesResource
-