org.teiid.query.sql.lang.Query.setCacheHint()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(502)

本文整理了Java中org.teiid.query.sql.lang.Query.setCacheHint方法的一些代码示例,展示了Query.setCacheHint的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setCacheHint方法的具体详情如下:
包路径:org.teiid.query.sql.lang.Query
类名称:Query
方法名:setCacheHint

Query.setCacheHint介绍

暂无

代码示例

代码示例来源:origin: org.teiid/teiid-olingo

hint.setTtl(getCacheTime());
hint.setScope(CacheDirective.Scope.USER);
query.setCacheHint(hint);

代码示例来源:origin: teiid/teiid

query.setCacheHint(hint);
qnode.setCommand(query);
cacheString = "matview"; //$NON-NLS-1$

代码示例来源:origin: org.teiid/teiid-engine

query.setCacheHint(hint);
qnode.setCommand(query);
cacheString = "matview"; //$NON-NLS-1$

代码示例来源:origin: org.jboss.teiid/teiid-engine

query.setCacheHint(hint);
qnode.setCommand(query);
cacheString = "matview"; //$NON-NLS-1$

代码示例来源:origin: teiid/teiid

@Test public void testExpandedCacheHint() {
  String sql = "/*+ cache( pref_mem ttl:2000) */ SELECT * FROM t1"; //$NON-NLS-1$
  
  Query query = new Query();
  Select select = new Select();
  select.addSymbol(new MultipleElementSymbol());
  query.setSelect(select);
  From from = new From();
  UnaryFromClause ufc = new UnaryFromClause();
  from.addClause(ufc);
  ufc.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
  query.setFrom(from);
  CacheHint hint = new CacheHint();
  hint.setPrefersMemory(true);
  hint.setTtl(Long.valueOf(2000));
  query.setCacheHint(hint);
  TestParser.helpTest(sql, "/*+ cache(pref_mem ttl:2000) */ SELECT * FROM t1", query);         //$NON-NLS-1$
}

代码示例来源:origin: teiid/teiid

@Test public void testCache() {
  String sql = "/*+ cache */ SELECT * FROM t1"; //$NON-NLS-1$
  
  Query query = new Query();
  Select select = new Select();
  select.addSymbol(new MultipleElementSymbol());
  query.setSelect(select);
  From from = new From();
  UnaryFromClause ufc = new UnaryFromClause();
  from.addClause(ufc);
  ufc.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
  query.setFrom(from);           
  query.setCacheHint(new CacheHint());
  TestParser.helpTest(sql, "/*+ cache */ SELECT * FROM t1", query);         //$NON-NLS-1$
}

代码示例来源:origin: teiid/teiid

@Test public void testCacheMultipleComments() {
  String sql = "/* hello */ /*+ cache */ /* world */ SELECT * FROM t1"; //$NON-NLS-1$
  
  Query query = new Query();
  Select select = new Select();
  select.addSymbol(new MultipleElementSymbol());
  query.setSelect(select);
  From from = new From();
  UnaryFromClause ufc = new UnaryFromClause();
  from.addClause(ufc);
  ufc.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
  query.setFrom(from);           
  query.setCacheHint(new CacheHint());
  TestParser.helpTest(sql, "/*+ cache */ SELECT * FROM t1", query);         //$NON-NLS-1$
}

代码示例来源:origin: teiid/teiid

@Test public void testCacheScope() {
  String sql = "/*+ cache(pref_mem scope:session) */ SELECT * FROM t1"; //$NON-NLS-1$
  
  Query query = new Query();
  Select select = new Select();
  select.addSymbol(new MultipleElementSymbol());
  query.setSelect(select);
  From from = new From();
  UnaryFromClause ufc = new UnaryFromClause();
  from.addClause(ufc);
  ufc.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
  query.setFrom(from);           
  CacheHint hint = new CacheHint();
  hint.setScope(Scope.SESSION);
  hint.setPrefersMemory(true);
  query.setCacheHint(hint);
  TestParser.helpTest(sql, "/*+ cache(pref_mem scope:SESSION) */ SELECT * FROM t1", query);         //$NON-NLS-1$
}

相关文章