HHH-15702 also add matching getters
This commit is contained in:
parent
778675b867
commit
215d411ffa
|
@ -205,6 +205,20 @@ public interface Session extends SharedSessionContract, EntityManager {
|
|||
*/
|
||||
CacheMode getCacheMode();
|
||||
|
||||
/**
|
||||
* The JPA-defined {@link CacheStoreMode}.
|
||||
*
|
||||
* @see #getCacheMode()
|
||||
*/
|
||||
CacheStoreMode getCacheStoreMode();
|
||||
|
||||
/**
|
||||
* The JPA-defined {@link CacheRetrieveMode}.
|
||||
*
|
||||
* @see #getCacheMode()
|
||||
*/
|
||||
CacheRetrieveMode getCacheRetrieveMode();
|
||||
|
||||
/**
|
||||
* Enable or disable writes to the second-level cache.
|
||||
*
|
||||
|
|
|
@ -202,6 +202,16 @@ public class SessionDelegatorBaseImpl implements SessionImplementor {
|
|||
return delegate.getCacheMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheRetrieveMode getCacheRetrieveMode() {
|
||||
return delegate.getCacheRetrieveMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheStoreMode getCacheStoreMode() {
|
||||
return delegate.getCacheStoreMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheMode(CacheMode cm) {
|
||||
delegate.setCacheMode( cm );
|
||||
|
|
|
@ -111,6 +111,16 @@ public class SessionLazyDelegator implements Session {
|
|||
this.lazySession.get().setCacheStoreMode( cacheStoreMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheStoreMode getCacheStoreMode() {
|
||||
return this.lazySession.get().getCacheStoreMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheRetrieveMode getCacheRetrieveMode() {
|
||||
return this.lazySession.get().getCacheRetrieveMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheMode getCacheMode() {
|
||||
return this.lazySession.get().getCacheMode();
|
||||
|
|
|
@ -1836,6 +1836,16 @@ public class SessionImpl
|
|||
persistenceContext.setReadOnly( entity, readOnly );
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheStoreMode getCacheStoreMode() {
|
||||
return getCacheMode().getJpaStoreMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheRetrieveMode getCacheRetrieveMode() {
|
||||
return getCacheMode().getJpaRetrieveMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheStoreMode(CacheStoreMode cacheStoreMode) {
|
||||
setCacheMode( fromJpaModes( getCacheMode().getJpaRetrieveMode(), cacheStoreMode ) );
|
||||
|
|
|
@ -285,6 +285,16 @@ public interface SelectionQuery<R> extends CommonQueryContract {
|
|||
*/
|
||||
CacheMode getCacheMode();
|
||||
|
||||
/**
|
||||
* @see #getCacheMode()
|
||||
*/
|
||||
CacheStoreMode getCacheStoreMode();
|
||||
|
||||
/**
|
||||
* @see #getCacheMode()
|
||||
*/
|
||||
CacheRetrieveMode getCacheRetrieveMode();
|
||||
|
||||
/**
|
||||
* Set the current {@link CacheMode} in effect for this query.
|
||||
*
|
||||
|
|
|
@ -686,6 +686,16 @@ public abstract class AbstractSelectionQuery<R>
|
|||
return getQueryOptions().getCacheMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheStoreMode getCacheStoreMode() {
|
||||
return getCacheMode().getJpaStoreMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheRetrieveMode getCacheRetrieveMode() {
|
||||
return getCacheMode().getJpaRetrieveMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectionQuery<R> setCacheMode(CacheMode cacheMode) {
|
||||
getQueryOptions().setCacheMode( cacheMode );
|
||||
|
|
Loading…
Reference in New Issue