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
  • Constructor Details

    • DeleteMethodImplementor

      public DeleteMethodImplementor(io.quarkus.deployment.Capabilities capabilities)
  • Method Details

    • 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 exposes RestDataResource.delete(Object) and the generated code looks more or less like this:
       
       @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);
           }
       }
       
       
      The RESTEasy Reactive version exposes 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:
      implementInternal in class StandardMethodImplementor
    • getResourceMethodName

      protected String getResourceMethodName()
      Description copied from class: StandardMethodImplementor
      Get a name of a method which this controller uses to access data.
      Specified by:
      getResourceMethodName in class StandardMethodImplementor