Uploaded image for project: 'Doma'
  1. Doma
  2. DOMA-300

[Core] @Select、@Function、@ResultSetにマッピング漏れを防ぐensureResultMapping要素を導入しました

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.34.0
    • Component/s: Core
    • Labels:
      None

      Description

      Employee.java
      @Entity
      public class Employee {
        @Id
        int id;
        String name;
        Integer age;
      }
      
      EmployeeDao.java
      public interface EmployeeDao {
        @Select
        List<Employee> select();
      }
      
      select.sql
      select id, name from Employee
      

      上記は、ageをマッピングし忘れている例。

      以下のように記述できるようにし、マッピング忘れを実行時例外で示せるようにする。

      EmployeeDao.java
      public interface EmployeeDao {
        @Select(ensureResultMapping = true)
        List<Employee> select();
      }
      

      ensureResultMapping要素を指定できるアノテーションは次の通り

      • @Select
      • @Function
      • @ResultSet

        Attachments

          Activity

            People

            • Assignee:
              taedium taedium
              Reporter:
              taedium taedium
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: