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

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

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

Query.getExecutionContext介绍

暂无

代码示例

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

private Object getResultFromMapRow(Map<String, Object> map)
{
  Object result = null;
  if (cypherResults == null || (candidateAliasName != null && cypherResults[0].equals(candidateAliasName)))
  {
    // Candidate result
    PropertyContainer node = (PropertyContainer) map.get(candidateAliasName);
    AbstractClassMetaData propObjCmd = Neo4jUtils.getClassMetaDataForPropertyContainer(node, query.getExecutionContext(), cmd);
    result = Neo4jUtils.getObjectForPropertyContainer(node, propObjCmd, query.getExecutionContext(), query.getIgnoreCache());
  }
  else
  {
    // Result clause specified, so extract into Object or Object[]
    if (cypherResults.length == 1)
    {
      result = map.get(cypherResults[0]);
    }
    else
    {
      result = new Object[cypherResults.length];
      for (int i=0;i<cypherResults.length;i++)
      {
        Array.set(result, i, map.get(cypherResults[i]));
      }
    }
  }
  return result;
}

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

/**
 * Convenience method to return if the specified query should use an "UPDATE" lock on returned objects.
 * First checks whether serializeRead is set on the query and, if not, falls back to the setting for the class.
 * @param query The query
 * @return Whether to use an "UPDATE" lock
 */
public static boolean useUpdateLockForQuery(Query query)
{
  if (query.getSerializeRead() != null)
  {
    if (!query.getExecutionContext().getTransaction().isActive())
    {
      // Only applies in a transaction
      return false;
    }
    // Query value takes top priority
    return query.getSerializeRead();
  }
  // Fallback to transaction or class itself
  return query.getExecutionContext().getSerializeReadForClass(query.getCandidateClassName());
}

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

public LazyLoadQueryResult(Query q)
  this.ec = q.getExecutionContext();

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

public void close()
{
  if (closed)
  {
    return;
  }
  closeAll();
  Boolean closeableQuery = query.getExecutionContext().getBooleanProperty(PROPERTY_CLOSEABLE_QUERY);
  if (closeableQuery == Boolean.TRUE)
  {
    // User has requested a closeable Query, so release connection to PM and underlying query etc
    if (this.fetchPlan != null)
    {
      this.fetchPlan.clearGroups();
      this.fetchPlan = null;
    }
    this.parameterValueByName = null;
    this.parameterValues = null;
    this.pm = null;
    this.query = null;
    this.closed = true;
  }
}

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

ExecutionContext ec = query.getExecutionContext();
Map<Integer, Object> memberValues = bulkLoadedValueByMemberNumber.get(api.getIdForObject(obj));
if (memberValues != null)

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

/**
 * Accessor for the result set concurrency for the specified query.
 * Uses the persistence property "datanucleus.rdbms.query.resultSetConcurrency" and allows it to be overridden by the query extension of the same name.
 * Checks both the NucleusContext and also the query extensions.
 * @param query The query
 * @return The result set concurrency string
 */
public static String getResultSetConcurrencyForQuery(Query query)
{
  String rsConcurrencyString = query.getExecutionContext().getNucleusContext().getConfiguration().getStringProperty(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_RESULT_SET_CONCURRENCY);
  Object rsConcurrencyExt = query.getExtension(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_RESULT_SET_CONCURRENCY);
  if (rsConcurrencyExt != null)
  {
    rsConcurrencyString = (String)rsConcurrencyExt;
  }
  return rsConcurrencyString;
}

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

/**
 * Accessor for the result set type for the specified query.
 * Uses the persistence property "datanucleus.rdbms.query.resultSetType" and allows it to be overridden by the query extension of the same name.
 * Checks both the NucleusContext and also the query extensions.
 * @param query The query
 * @return The result set type string
 */
public static String getResultSetTypeForQuery(Query query)
{
  String rsTypeString = query.getExecutionContext().getNucleusContext().getConfiguration().getStringProperty(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_RESULT_SET_TYPE);
  Object rsTypeExt = query.getExtension(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_RESULT_SET_TYPE);
  if (rsTypeExt != null)
  {
    rsTypeString = (String)rsTypeExt;
  }
  return rsTypeString;
}

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

@Override
public JDOQLTypedQuery<T> saveAsNamedQuery(String name)
{
  assertIsOpen();
  JDOPersistenceManagerFactory.checkJDOPermission(JDOPermission.GET_METADATA);
  QueryMetaData qmd = new QueryMetaData(name);
  qmd.setLanguage(Query.LANGUAGE_JDOQL);
  Query query = getInternalQuery();
  qmd.setQuery(query.toString());
  qmd.setResultClass(query.getResultClassName());
  qmd.setUnique(query.isUnique());
  Map<String, Object> queryExts = query.getExtensions();
  if (queryExts != null && !queryExts.isEmpty())
  {
    Iterator<Map.Entry<String, Object>> queryExtsIter = queryExts.entrySet().iterator();
    while (queryExtsIter.hasNext())
    {
      Map.Entry<String, Object> queryExtEntry = queryExtsIter.next();
      qmd.addExtension(queryExtEntry.getKey(), "" + queryExtEntry.getValue());
    }
  }
  query.getExecutionContext().getMetaDataManager().registerNamedQuery(qmd);
  return this;
}

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

if (memberValues != null)
  ObjectProvider op = query.getExecutionContext().findObjectProvider(nextElement);
  Iterator<Map.Entry<Integer, Object>> memberValIter = memberValues.entrySet().iterator();
  while (memberValIter.hasNext())

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

this.ec = q.getExecutionContext();
this.cmd = ec.getMetaDataManager().getMetaDataForClass(query.getCandidateClass(), ec.getClassLoaderResolver());
this.result = result;

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

query.getExecutionContext().getMetaDataManager().registerNamedQuery(qmd);

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

Query query, Map parameters, RDBMSQueryCompilation datastoreCompilation, Set<String> mapperOptions)
ExecutionContext ec = query.getExecutionContext();
ClassLoaderResolver clr = ec.getClassLoaderResolver();
RDBMSStoreManager storeMgr = (RDBMSStoreManager) query.getStoreManager();

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

Configuration conf = query.getExecutionContext().getNucleusContext().getConfiguration();
String fetchDir = conf.getStringProperty(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_FETCH_DIRECTION);
Object fetchDirExt = query.getExtension(RDBMSPropertyNames.PROPERTY_RDBMS_QUERY_FETCH_DIRECTION);

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

ExecutionContext ec = q.getExecutionContext();
StoreManager storeMgr = ec.getStoreManager();
ClassLoaderResolver clr = ec.getClassLoaderResolver();

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

ExecutionContext ec = query.getExecutionContext();
AbstractMemberMetaData mmd = iterStmt.getBackingStore().getOwnerMemberMetaData();
if (mmd.hasCollection() || mmd.hasArray())

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

ExecutionContext ec = query.getExecutionContext();
ClassLoaderResolver clr = ec.getClassLoaderResolver();
RDBMSStoreManager storeMgr = (RDBMSStoreManager) query.getStoreManager();

相关文章