Class DeleteMethodImplementor
- java.lang.Object
-
- io.quarkus.rest.data.panache.deployment.methods.StandardMethodImplementor
-
- io.quarkus.rest.data.panache.deployment.methods.DeleteMethodImplementor
-
- All Implemented Interfaces:
MethodImplementor
public final class DeleteMethodImplementor extends StandardMethodImplementor
-
-
Field Summary
-
Fields inherited from class io.quarkus.rest.data.panache.deployment.methods.StandardMethodImplementor
responseImplementor
-
Fields inherited from interface io.quarkus.rest.data.panache.deployment.methods.MethodImplementor
APPLICATION_HAL_JSON, APPLICATION_JSON
-
-
Constructor Summary
Constructors Constructor Description DeleteMethodImplementor(io.quarkus.deployment.Capabilities capabilities)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetResourceMethodName()Get a name of a method which this controller uses to access data.protected voidimplementInternal(io.quarkus.gizmo.ClassCreator classCreator, ResourceMetadata resourceMetadata, ResourceProperties resourceProperties, io.quarkus.gizmo.FieldDescriptor resourceField)Generate JAX-RS DELETE method.-
Methods inherited from class io.quarkus.rest.data.panache.deployment.methods.StandardMethodImplementor
addConsumesAnnotation, addContextAnnotation, addDefaultValueAnnotation, addDeleteAnnotation, addGetAnnotation, addLinksAnnotation, addMethodAnnotations, addOpenApiResponseAnnotation, addOpenApiResponseAnnotation, addOpenApiResponseAnnotation, addOpenApiResponseAnnotation, addPathAnnotation, addPathParamAnnotation, addPostAnnotation, addProducesAnnotation, addProducesJsonAnnotation, addPutAnnotation, addQueryParamAnnotation, addSecurityAnnotations, addSortQueryParamValidatorAnnotation, appendToPath, hasSecurityCapability, hasValidatorCapability, implement, implementTryBlock, isNotReactivePanache, isResteasyClassic
-
-
-
-
Method Detail
-
implementInternal
protected void implementInternal(io.quarkus.gizmo.ClassCreator classCreator, ResourceMetadata resourceMetadata, ResourceProperties resourceProperties, io.quarkus.gizmo.FieldDescriptor resourceField)Generate JAX-RS DELETE method. The RESTEasy Classic version exposesRestDataResource.delete(Object)and the generated code looks more or less like this:
The RESTEasy Reactive version exposes@DELETE @Path("{id}") @LinkResource(rel = "remove", entityClassName = "com.example.Entity") public Response delete(@PathParam("id") ID id) throws RestDataPanacheException { try { boolean deleted = restDataResource.delete(id); if (deleted) { return Response.noContent().build(); } else { return Response.status(404).build(); } } catch (Throwable t) { throw new RestDataPanacheException(t); } }ReactiveRestDataResource.delete(Object)and the generated code looks more or less like this:@DELETE @Path("{id}") @LinkResource(rel = "remove", entityClassName = "com.example.Entity") public Uni<Response> delete(@PathParam("id") ID id) throws RestDataPanacheException { try { return restDataResource.delete(id) .map(deleted -> deleted ? Response.noContent().build() : Response.status(404).build()); } catch (Throwable t) { throw new RestDataPanacheException(t); } }- Specified by:
implementInternalin classStandardMethodImplementor
-
getResourceMethodName
protected String getResourceMethodName()
Description copied from class:StandardMethodImplementorGet a name of a method which this controller uses to access data.- Specified by:
getResourceMethodNamein classStandardMethodImplementor
-
-