Class DeleteMethodImplementor

    • Constructor Detail

      • DeleteMethodImplementor

        public DeleteMethodImplementor​(boolean isResteasyClassic,
                                       boolean isReactivePanache)
    • 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 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