#1268 - SQL Server fix for "for update" plus Sequences support plus refactor of sequences

This commit is contained in:
Rob Bygrave
2018-02-22 22:45:44 +13:00
parent e3fac7c622
commit f8ea5619d0
32 changed files with 439 additions and 182 deletions
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.query;
import io.ebean.Query;
import io.ebean.RawSql;
import io.ebean.RawSqlBuilder;
import io.ebean.annotation.Platform;
@@ -671,4 +672,16 @@ class CQueryBuilder {
boolean isPlatformDistinctOn() {
return dbPlatform.isPlatform(Platform.POSTGRES);
}
/**
* Return the 'for update' FROM hint (sql server).
*/
public String fromForUpdate(SpiQuery<?> query) {
Query.ForUpdate mode = query.getForUpdateMode();
if (mode == null) {
return null;
} else {
return dbPlatform.fromForUpdate(mode);
}
}
}