Module org.jooq
Package org.jooq.impl

Interface AnnotatedPojoMemberProvider


@Internal public interface AnnotatedPojoMemberProvider
An SPI that can be used to provide jakarta.persistence style annotations to the DefaultRecordMapper.

Starting with jOOQ 3.20 and https://github.com/jOOQ/jOOQ/issues/16500, the

invalid reference
jakarta.persistence.Column
(and similar) annotation support has been moved out of the core library to the jOOQ-jpa-extensions module, to allow for:

  • Removal of the dependency on the jakarta.persistence module from the core library
  • Maintenance of backwards compatibility for those users using the annotation

Implementations can be provided to Configuration.annotatedPojoMemberProvider().

This SPI is internal and should not be implemented, as it might change incompatibly in the future. Instead, use the default implementation provided by the jOOQ-jpa-extensions module.

Author:
Lukas Eder
  • Method Details

    • hasAnnotations

      boolean hasAnnotations(Class<?> type)
      Check whether a type has any annotated members.
      Parameters:
      type - The POJO type.
      Returns:
      Whether it has annotated members.
    • getMembers

      @NotNull @NotNull List<Field> getMembers(Class<?> type, String name)
      Get a POJO's annotated members for a given column name.

      If multiple members match for a given type and column name, then:

      Parameters:
      type - The POJO type.
      name - The column name.
      Returns:
      The list of members that match.
    • getGetters

      @NotNull @NotNull List<Method> getGetters(Class<?> type, String name)
      Get a POJO's annotated getters for a given column name.

      If multiple getters match for a given type and column name, then the DefaultRecordUnmapper will read the column value from the first getter.

      Parameters:
      type - The POJO type.
      name - The column name.
      Returns:
      The list of getters that match.
    • getSetters

      @NotNull @NotNull List<Method> getSetters(Class<?> type, String name)
      Get a POJO's annotated setters for a given column name.

      If multiple setters match for a given type and column name, then the DefaultRecordMapper will write the column value to all the setters.

      Parameters:
      type - The POJO type.
      name - The column name.
      Returns:
      The list of setters that match.