@Options

· MyBatis
AUTO INCREMENT를 지원해 주는 DBMS의 경우 @Options(useGeneratedKeys=true, keyProperty = “id”) public class User { private int id; private String name; // getters and setters... } @Mapper public interface UserMapper { @Insert("INSERT INTO users (name) VALUES (#{name})") @Options(useGeneratedKeys = true, keyProperty = "id") int insert(User user); } useGeneratedKeys: 이 속성을 true로 설정하면 MyBatis가 쿼리 실행 후에 데이터베이스..
Night-east
'@Options' 태그의 글 목록