When using PostgreSQL, the SQL issued when DuplicateKeyType.IGNORE is specified has been changed.
Assume the following DAO definition:
@Dao
public interface DeptDao {
@Insert(duplicateKeyType = DuplicateKeyType.IGNORE)
int insertOnDuplicateKeyIgnore(Dept entity);
}
Previously, the SQL corresponding to the above DAO was as follows:
insert into DEPARTMENT as target (DEPARTMENT_ID, DEPARTMENT_NO, DEPARTMENT_NAME, LOCATION, VERSION) values (5, 50, 'PLANNING_preI(I)', 'TOKYO', 1) on conflict (DEPARTMENT_ID) do nothing
After applying this PR, the following SQL will be issued:
insert into DEPARTMENT as target (DEPARTMENT_ID, DEPARTMENT_NO, DEPARTMENT_NAME, LOCATION, VERSION) values (5, 50, 'PLANNING_preI(I)', 'TOKYO', 1) on conflict do nothing
This behavior is the same in the Criteria API as well.
Note
This PR changes the classes used to implement UPSERT queries. If you have independently extended the UPSERT functionality, it may be affected.
When using PostgreSQL, the SQL issued when
DuplicateKeyType.IGNORE
is specified has been changed.Assume the following DAO definition:
Previously, the SQL corresponding to the above DAO was as follows:
After applying this PR, the following SQL will be issued:
This behavior is the same in the Criteria API as well.
Note
This PR changes the classes used to implement UPSERT queries. If you have independently extended the UPSERT functionality, it may be affected.