Annotation Interface ResultSet


@Target(PARAMETER) @Retention(RUNTIME) public @interface ResultSet
Indicates a parameter that receives a result set fetched by stored functions or stored procedures.

The annotated parameter type must be List and it must be one of parameters of the method that is annotated with Function or Procedure.

 @Dao
 public interface EmployeeDao {

     @Procedure
     void fetchEmployees(@In Integer departmentId, @ResultSet List<Employee> employees);
 }
 
 EmployeeDao dao = new EmployeeDaoImpl(config);
 List<Employee> employees = new ArrayList<Employee>();
 dao.fetchEmployees(10, employees);
 for (Employee e : employees) {
     ...
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to ensure that all entity properties are mapped to columns of a result set.
  • Element Details

    • ensureResultMapping

      boolean ensureResultMapping
      Whether to ensure that all entity properties are mapped to columns of a result set.

      This value is used only if the result set is fetched as an entity or a entity list.

      If true and there are some unmapped properties, ResultMappingException is thrown from the annotated method.

      Returns:
      whether to ensure that all entity properties are mapped to columns of a result set
      Default:
      false