use of org.hibernate.cache.spi.access.CachedDomainDataAccess in project infinispan by infinispan.
the class CorrectnessTestCase method getPutFromLoadValidator.
private PutFromLoadValidator getPutFromLoadValidator(SessionFactoryImplementor sfi, String regionName) throws NoSuchFieldException, IllegalAccessException {
// TODO not sure if this is correct.
CachedDomainDataAccess strategy = sfi.getMetamodel().entityPersister(Family.class).getCacheAccessStrategy();
if (strategy == null) {
return null;
}
Field delegateField = getField(strategy.getClass(), "delegate");
Object delegate = delegateField.get(strategy);
if (delegate == null) {
return null;
}
if (InvalidationCacheAccessDelegate.class.isInstance(delegate)) {
Field validatorField = InvalidationCacheAccessDelegate.class.getDeclaredField("putValidator");
validatorField.setAccessible(true);
return (PutFromLoadValidator) validatorField.get(delegate);
} else {
return null;
}
}
Aggregations