com.oracle.coherence.hibernate.cache.region.CoherenceGeneralDataRegion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coherence-hibernate-cache-4 Show documentation
Show all versions of coherence-hibernate-cache-4 Show documentation
A Coherence-based implementation of the second-level cache SPI introduced in Hibernate 3.3.
The newest version!
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package com.oracle.coherence.hibernate.cache.region;
import com.tangosol.net.NamedCache;
import org.hibernate.cache.spi.GeneralDataRegion;
import java.util.Properties;
/**
* A CoherenceGeneralDataRegion is a CoherenceRegion holding "general" (i.e., non-transactional) data.
*
* @author Randy Stafford
*/
public abstract class CoherenceGeneralDataRegion
extends CoherenceRegion
implements GeneralDataRegion
{
// ---- Constructors
/**
* Complete constructor.
*
* @param namedCache the NamedCache implementing this CoherenceGeneralDataRegion
* @param properties configuration properties for this CoherenceGeneralDataRegion
*/
public CoherenceGeneralDataRegion(NamedCache namedCache, Properties properties)
{
super(namedCache, properties);
}
// ---- Interface org.hibernate.cache.spi.GeneralDataRegion
/**
* {@inheritDoc}
*/
@Override
public Object get(Object key)
{
Value cacheValue = super.getValue(key);
return (cacheValue == null) ? null : cacheValue.getValue();
}
/**
* {@inheritDoc}
*/
@Override
public void put(Object key, Object value)
{
super.putValue(key, new Value(value, null, nextTimestamp()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy