Here are the examples of the java api org.hibernate.CacheMode.NORMAL taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
6 Examples
19
Source : HibernateUtil.java
with MIT License
from ConnectedPlacesCatapult
with MIT License
from ConnectedPlacesCatapult
public static void startUpForPython() {
sessionFactory = buildSessionFactoryForPython();
sharedSession = sessionFactory.openSession();
sharedSession.setCacheMode(CacheMode.NORMAL);
}
19
Source : HibernateUtil.java
with MIT License
from ConnectedPlacesCatapult
with MIT License
from ConnectedPlacesCatapult
public static void startup() {
sessionFactory = buildSessionFactory();
sharedSession = sessionFactory.openSession();
sharedSession.setCacheMode(CacheMode.NORMAL);
}
18
Source : QueryBinder.java
with GNU General Public License v2.0
from lamsfoundation
with GNU General Public License v2.0
from lamsfoundation
private static CacheMode getCacheMode(CacheModeType cacheModeType) {
switch(cacheModeType) {
case GET:
return CacheMode.GET;
case IGNORE:
return CacheMode.IGNORE;
case NORMAL:
return CacheMode.NORMAL;
case PUT:
return CacheMode.PUT;
case REFRESH:
return CacheMode.REFRESH;
default:
throw new replacedertionFailure("Unknown cacheModeType: " + cacheModeType);
}
}
18
Source : CacheModeConverter.java
with GNU General Public License v2.0
from lamsfoundation
with GNU General Public License v2.0
from lamsfoundation
public static CacheMode fromXml(String name) {
for (CacheMode mode : CacheMode.values()) {
if (mode.name().equalsIgnoreCase(name)) {
return mode;
}
}
return CacheMode.NORMAL;
}
17
Source : HibernatePersistenceService.java
with Apache License 2.0
from spot-next
with Apache License 2.0
from spot-next
protected <T, Q extends io.spotnext.core.persistence.query.Query<T>> void setCacheSettings(final Session session, final Q sourceQuery, final TypedQuery<T> query) {
CacheMode cacheMode = CacheMode.NORMAL;
if (!sourceQuery.isCachable() && !sourceQuery.isIgnoreCache()) {
cacheMode = CacheMode.GET;
} else if (!sourceQuery.isCachable() && sourceQuery.isIgnoreCache()) {
cacheMode = CacheMode.IGNORE;
} else if (sourceQuery.isCachable() && sourceQuery.isIgnoreCache()) {
cacheMode = CacheMode.PUT;
}
session.setCacheMode(cacheMode);
// query.setHint("org.hibernate.cacheable", sourceQuery.isCachable());
query.setHint("javax.persistence.cache.retrieveMode", sourceQuery.isIgnoreCache() ? CacheRetrieveMode.BYPreplaced : CacheRetrieveMode.USE);
}
13
Source : HibernateSearchDaoImpl.java
with Apache License 2.0
from igloo-project
with Apache License 2.0
from igloo-project
protected void reindexClreplacedes(FullTextEnreplacedyManager fullTextEnreplacedyManager, Set<Clreplaced<?>> enreplacedyClreplacedes) throws InterruptedException {
int batchSize = propertyService.get(HIBERNATE_SEARCH_REINDEX_BATCH_SIZE);
int loadThreads = propertyService.get(HIBERNATE_SEARCH_REINDEX_LOAD_THREADS);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Targets for indexing job: {}", enreplacedyClreplacedes);
}
for (Clreplaced<?> clazz : enreplacedyClreplacedes) {
ProgressMonitor progressMonitor = new ProgressMonitor();
Thread t = new Thread(progressMonitor);
LOGGER.info(String.format("Reindexing %1$s.", clazz));
t.start();
MreplacedIndexer indexer = fullTextEnreplacedyManager.createIndexer(clazz);
indexer.batchSizeToLoadObjects(batchSize).threadsToLoadObjects(loadThreads).cacheMode(CacheMode.NORMAL).progressMonitor(progressMonitor).startAndWait();
progressMonitor.stop();
t.interrupt();
LOGGER.info(String.format("Reindexing %1$s done.", clazz));
}
}