HHH-8426 Add defaultScrollMode to Dialect
This commit is contained in:
parent
6c708e2180
commit
a2da429997
|
@ -45,6 +45,7 @@ import org.hibernate.LockMode;
|
|||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.NullPrecedence;
|
||||
import org.hibernate.ScrollMode;
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.dialect.function.CastFunction;
|
||||
import org.hibernate.dialect.function.SQLFunction;
|
||||
|
@ -2670,5 +2671,14 @@ public abstract class Dialect implements ConversionContext {
|
|||
*/
|
||||
public String getQueryHintString(String query, List<String> hints) {
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Certain dialects support a subset of ScrollModes. Provide a default to be used by Criteria and Query.
|
||||
*
|
||||
* @return ScrollMode
|
||||
*/
|
||||
public ScrollMode defaultScrollMode() {
|
||||
return ScrollMode.SCROLL_INSENSITIVE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ public class CriteriaImpl implements Criteria, Serializable {
|
|||
}
|
||||
@Override
|
||||
public ScrollableResults scroll() {
|
||||
return scroll( ScrollMode.SCROLL_INSENSITIVE );
|
||||
return scroll( session.getFactory().getDialect().defaultScrollMode() );
|
||||
}
|
||||
@Override
|
||||
public ScrollableResults scroll(ScrollMode scrollMode) {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class QueryImpl extends AbstractQueryImpl {
|
|||
}
|
||||
|
||||
public ScrollableResults scroll() throws HibernateException {
|
||||
return scroll( ScrollMode.SCROLL_INSENSITIVE );
|
||||
return scroll( session.getFactory().getDialect().defaultScrollMode() );
|
||||
}
|
||||
|
||||
public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException {
|
||||
|
|
|
@ -171,7 +171,7 @@ public class SQLQueryImpl extends AbstractQueryImpl implements SQLQuery {
|
|||
}
|
||||
|
||||
public ScrollableResults scroll() throws HibernateException {
|
||||
return scroll(ScrollMode.SCROLL_INSENSITIVE);
|
||||
return scroll( session.getFactory().getDialect().defaultScrollMode() );
|
||||
}
|
||||
|
||||
public Iterator iterate() throws HibernateException {
|
||||
|
|
Loading…
Reference in New Issue