Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
package org.hibernate.sql.exec.internal;

import org.hibernate.CacheMode;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.spi.QueryOptions;
import org.hibernate.query.spi.QueryProducerImplementor;
import org.hibernate.sql.exec.spi.ExecutionContext;

import static org.hibernate.internal.util.NullnessHelper.coalesceSuppliedValues;
Expand All @@ -27,15 +27,15 @@ public static CacheMode resolveCacheMode(ExecutionContext executionContext) {
return resolveCacheMode( executionContext.getQueryOptions(), executionContext.getSession() );
}

public static CacheMode resolveCacheMode(QueryOptions options, SharedSessionContractImplementor session) {
public static CacheMode resolveCacheMode(QueryOptions options, QueryProducerImplementor session) {
return coalesceSuppliedValues(
() -> options == null ? null : options.getCacheMode(),
session::getCacheMode,
() -> CacheMode.NORMAL
);
}

public static CacheMode resolveCacheMode(CacheMode override, SharedSessionContractImplementor session) {
public static CacheMode resolveCacheMode(CacheMode override, QueryProducerImplementor session) {
return coalesceSuppliedValues(
() -> override,
session::getCacheMode,
Expand Down
Loading