1
커스텀 매핑 :MyBatis로 나는이 같은 자바 빈을 정의한
public class Person{
private int id;
private String name;
private Map<String, Object> properties;
// getters and setters ...
}
후속 쿼리 줄 : 나는 Person 클래스의에 "ID"와 "이름"열을 매핑 할
select id, name, age, address from users;
을 "id"및 "name"속성을 사용하지만 "age"및 "address"열을 "properties"맵에 키 - 값 쌍으로 매핑합니다.
mybatis에서도 가능합니까? mybatis의 최신 버전을 사용하고 있습니다.