org.datanucleus.store.query.Query.addExtension()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(153)

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

Query.addExtension介绍

暂无

代码示例

代码示例来源:origin: org.datanucleus/datanucleus-jpa

/**
 * Method to add a vendor extension to the query.
 * If the hint name is not recognized, it is silently ignored.
 * @param hintName Name of the "hint"
 * @param value Value for the "hint"
 * @return the same query instance
 * @throws IllegalArgumentException if the second argument is not valid for the implementation
 */
public JPAQuery<X> setHint(String hintName, Object value)
{
  // Just treat a "hint" as an "extension".
  query.addExtension(hintName, value);
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-java5

/**
 * Method to add a vendor extension to the query.
 * If the hint name is not recognized, it is silently ignored.
 * @param hintName Name of the "hint"
 * @param value Value for the "hint"
 * @return the same query instance
 * @throws IllegalArgumentException if the second argument is not valid for the implementation
 */
public Query setHint(String hintName, Object value)
{
  // Just treat a "hint" as an "extension".
  query.addExtension(hintName, value);
  return this;
}

代码示例来源:origin: org.datanucleus/datanucleus-api-jdo

/**
 * Method to add an extension to the query.
 * @param key Key for the extension
 * @param value Value for the extension
 */
public void addExtension(String key, Object value)
{
  assertIsOpen();
  query.addExtension(key, value);
}

代码示例来源:origin: com.blazebit/blaze-persistence-integration-datanucleus-5.1

private void applySql(Query query, String sqlOverride) {
  // TODO: parameter handling
  org.datanucleus.store.query.Query<?> dnQuery = query.unwrap(org.datanucleus.store.query.Query.class);
  // Disable caching for these queries
  dnQuery.addExtension("datanucleus.query.compilation.cached", Boolean.FALSE);
  try {
    RDBMSQueryCompilation datastoreCompilation = (RDBMSQueryCompilation) DATASTORE_COMPILATION_FIELD.get(dnQuery);
    datastoreCompilation.setSQL(sqlOverride);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: Blazebit/blaze-persistence

private void applySql(Query query, String sqlOverride) {
  // TODO: parameter handling
  org.datanucleus.store.query.Query<?> dnQuery = query.unwrap(org.datanucleus.store.query.Query.class);
  // Disable caching for these queries
  dnQuery.addExtension("datanucleus.query.compilation.cached", Boolean.FALSE);
  try {
    RDBMSQueryCompilation datastoreCompilation = (RDBMSQueryCompilation) DATASTORE_COMPILATION_FIELD.get(dnQuery);
    datastoreCompilation.setSQL(sqlOverride);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: Blazebit/blaze-persistence

private void applySql(Query query, String sqlOverride) {
  // TODO: parameter handling
  org.datanucleus.store.query.Query<?> dnQuery = query.unwrap(org.datanucleus.store.query.Query.class);
  // Disable caching for these queries
  dnQuery.addExtension("datanucleus.query.compilation.cached", Boolean.FALSE);
  try {
    RDBMSQueryCompilation datastoreCompilation = (RDBMSQueryCompilation) DATASTORE_COMPILATION_FIELD.get(dnQuery);
    datastoreCompilation.setSQL(sqlOverride);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.datanucleus/datanucleus-api-jdo

internalQuery.addExtension(org.datanucleus.store.query.Query.EXTENSION_FLUSH_BEFORE_EXECUTION, Boolean.TRUE);

代码示例来源:origin: org.datanucleus/datanucleus-api-jdo

internalQuery.addExtension(Query.EXTENSION_FLUSH_BEFORE_EXECUTION, Boolean.TRUE);

相关文章