Enable disallowBatchOnCascade per DatabasePlatform (added for SQL Server)

This commit is contained in:
rbygrave
2014-12-17 00:28:28 +13:00
parent 59428bb214
commit b0462bcda6
@@ -99,7 +99,14 @@ public class DatabasePlatform {
* findIterate() and findVisit().
*/
protected boolean forwardOnlyHintOnFindIterate;
/**
* Flag set for SQL Server due to lack of support of getGeneratedKeys in
* batch mode (meaning for batch inserts you should explicitly turn off
* getGeneratedKeys - joy).
*/
protected boolean disallowBatchOnCascade;
/**
* Instantiates a new database platform.
*/
@@ -367,4 +374,15 @@ public class DatabasePlatform {
public String getLikeClause() {
return likeClause;
}
/**
* Return true if the persistBatchOnCascade setting should be ignored.
* <p>
* This is primarily for SQL Server which does not support getGeneratedKeys with jdbc batch mode
* so can't really be transparently used.
* </p>
*/
public boolean isDisallowBatchOnCascade() {
return disallowBatchOnCascade;
}
}