本文整理了Java中org.infinispan.Cache.getOrDefault()
方法的一些代码示例,展示了Cache.getOrDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.getOrDefault()
方法的具体详情如下:
包路径:org.infinispan.Cache
类名称:Cache
方法名:getOrDefault
暂无
代码示例来源:origin: org.infinispan/infinispan-core
public void testGetOrDefault() {
cache.put("A", "B");
assertEquals("K", cache.getOrDefault("Not there", "K"));
}
代码示例来源:origin: org.infinispan/infinispan-core
public void testGetOrDefault() {
cache.put("A", "B");
assertEquals("K", cache.getOrDefault("Not there", "K"));
}
代码示例来源:origin: hibernate/hibernate-ogm
/**
* Returns the result of a stored procedure executed on the backend.
*
* @param embeddedCacheManager embedded cache manager
* @param storedProcedureName name of stored procedure
* @param queryParameters parameters passed for this query
* @param classLoaderService the class loader service
*
* @return a {@link ClosableIterator} with the result of the query
*/
public ClosableIterator<Tuple> callStoredProcedure(EmbeddedCacheManager embeddedCacheManager, String storedProcedureName, ProcedureQueryParameters queryParameters, ClassLoaderService classLoaderService ) {
validate( queryParameters );
Cache<String, String> cache = embeddedCacheManager.getCache( STORED_PROCEDURES_CACHE_NAME, true );
String className = cache.getOrDefault( storedProcedureName, storedProcedureName );
Callable<?> callable = instantiate( storedProcedureName, className, classLoaderService );
setParams( storedProcedureName, queryParameters, callable );
Object res = execute( storedProcedureName, embeddedCacheManager, callable );
return extractResultSet( storedProcedureName, res );
}
代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-infinispan-embedded
/**
* Returns the result of a stored procedure executed on the backend.
*
* @param embeddedCacheManager embedded cache manager
* @param storedProcedureName name of stored procedure
* @param queryParameters parameters passed for this query
* @param classLoaderService the class loader service
*
* @return a {@link ClosableIterator} with the result of the query
*/
public ClosableIterator<Tuple> callStoredProcedure(EmbeddedCacheManager embeddedCacheManager, String storedProcedureName, ProcedureQueryParameters queryParameters, ClassLoaderService classLoaderService ) {
validate( queryParameters );
Cache<String, String> cache = embeddedCacheManager.getCache( STORED_PROCEDURES_CACHE_NAME, true );
String className = cache.getOrDefault( storedProcedureName, storedProcedureName );
Callable<?> callable = instantiate( storedProcedureName, className, classLoaderService );
setParams( storedProcedureName, queryParameters, callable );
Object res = execute( storedProcedureName, embeddedCacheManager, callable );
return extractResultSet( storedProcedureName, res );
}
内容来源于网络,如有侵权,请联系作者删除!