Class CountMethodImplementor

java.lang.Object
io.quarkus.rest.data.panache.deployment.methods.StandardMethodImplementor
io.quarkus.rest.data.panache.deployment.methods.CountMethodImplementor
All Implemented Interfaces:
MethodImplementor

public final class CountMethodImplementor extends StandardMethodImplementor
  • Constructor Details

    • CountMethodImplementor

      public CountMethodImplementor(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 GET method. The RESTEasy Classic version exposes RestDataResource.count().
       
       @GET
       @Path("/count")
       public long count() {
           try {
               return resource.count();
           } catch (Throwable t) {
               throw new RestDataPanacheException(t);
           }
       }
       
       
      The RESTEasy Reactive version exposes ReactiveRestDataResource.count() and the generated code looks more or less like this:
       
       @GET
       @Path("/count")
       @LinkResource(rel = "count", entityClassName = "com.example.Entity")
       public Uni<Long> count() {
           try {
               return resource.count();
           } 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