Annotation Type QuarkusMapper


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface QuarkusMapper
    Companion annotation to the driver's Mapper annotation. It allows to customize Quarkus-specific features when generating code for a Mapper-annotated interface.

    Currently only one attribute is supported: generateProducers(). When the annotation is absent, or when it is present and the attribute is true (the default), bean producers will be generated for the annotated Mapper interface itself, and for all of the DAO factory methods declared in it, except those taking arguments. This makes it possible to inject such beans automatically. When the attribute is false, the mapper annotation processor will skip the generation of bean producers completely, and injection of such beans has to be done manually.

    Example:

     @Mapper
     @QuarkusMapper(generateProducers=false)
     public interface InventoryMapper {
       @DaoFactory
       ProductDao productDao();
     }
     
    The mapper annotation processor would still generate an implementation and a builder for the above Mapper interface, but no bean producer would be generated.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean generateProducers
      Whether to generate producers.
    • Element Detail

      • generateProducers

        boolean generateProducers
        Whether to generate producers. When the annotation is absent, or when it is present and the attribute is true (the default), CDI bean producers will be generated for the annotated Mapper interface itself, and for all of the DAO factory methods declared in it, except those taking arguments. This makes it possible to inject such beans automatically. If you want to turn off this feature, set this attribute to false.
        Default:
        true