Minor code cleaning

This commit is contained in:
Andrea Boriero 2021-09-15 09:31:45 +02:00
parent b2aca3c846
commit 9d131ce69f
2 changed files with 3 additions and 1 deletions

View File

@ -547,12 +547,14 @@ public class QuerySqmImpl<R>
throw new PersistenceException( "Unrecognized unwrap type [" + cls.getName() + "]" );
}
@Override
protected boolean applyNativeQueryLockMode(Object value) {
throw new IllegalStateException(
"Illegal attempt to set lock mode on non-native query via hint; use Query#setLockMode instead"
);
}
@Override
protected boolean applySynchronizeSpacesHint(Object value) {
throw new IllegalStateException(
"Illegal attempt to set synchronized spaces on non-native query via hint"

View File

@ -71,7 +71,7 @@ public class DeferredResultSetAccess extends AbstractResultSetAccess {
// Note that limit and lock aren't set for SQM as that is applied during SQL rendering
// But for native queries, we have to adapt the SQL string
final Dialect dialect = executionContext.getSession().getJdbcServices().getDialect();
String sql = jdbcSelect.getSql();
String sql;
limit = queryOptions.getLimit();
if ( limit == null || limit.isEmpty() || jdbcSelect.usesLimitParameters() ) {
sql = jdbcSelect.getSql();