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

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

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

Query.setResultMetaData介绍

暂无

代码示例

代码示例来源:origin: com.force.sdk/force-jpa

/**
 * Create an instance of Query for executing an SOQL query.
 * @param soqlString a native SOQL query string
 * @param resultSetMapping the name of the result set mapping
 * @return the new query instance
 */
@Override
public Query createNativeQuery(String soqlString, String resultSetMapping) {
  assertIsOpen();
  try {
    org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
        SOQL_LANGUAGE, om.getExecutionContext(), soqlString);
    QueryResultMetaData qrmd = om.getMetaDataManager().getMetaDataForQueryResult(resultSetMapping);
    if (qrmd == null) {
      // TODO Localise this, and check if it is the correct exception to throw
      throw new IllegalArgumentException("ResultSetMapping " + resultSetMapping + " is not found");
    }
    internalQuery.setResultMetaData(qrmd);
    return new JPAQuery(this, internalQuery, SOQL_LANGUAGE);
  } catch (NucleusException ne) {
    throw new IllegalArgumentException(ne.getMessage(), ne);
  }
}

代码示例来源:origin: forcedotcom/java-sdk

/**
 * Create an instance of Query for executing an SOQL query.
 * @param soqlString a native SOQL query string
 * @param resultSetMapping the name of the result set mapping
 * @return the new query instance
 */
@Override
public Query createNativeQuery(String soqlString, String resultSetMapping) {
  assertIsOpen();
  try {
    org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
        SOQL_LANGUAGE, om.getExecutionContext(), soqlString);
    QueryResultMetaData qrmd = om.getMetaDataManager().getMetaDataForQueryResult(resultSetMapping);
    if (qrmd == null) {
      // TODO Localise this, and check if it is the correct exception to throw
      throw new IllegalArgumentException("ResultSetMapping " + resultSetMapping + " is not found");
    }
    internalQuery.setResultMetaData(qrmd);
    return new JPAQuery(this, internalQuery, SOQL_LANGUAGE);
  } catch (NucleusException ne) {
    throw new IllegalArgumentException(ne.getMessage(), ne);
  }
}

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

/**
 * Create an instance of Query for executing an SQL query.
 * @param sqlString a native SQL query string
 * @param resultSetMapping the name of the result set mapping
 * @return the new query instance
 */
public Query createNativeQuery(String sqlString, String resultSetMapping)
{
  assertIsOpen();
  try
  {
    org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
      QueryLanguage.SQL.toString(), om.getExecutionContext(), sqlString);
    QueryResultMetaData qrmd = om.getMetaDataManager().getMetaDataForQueryResult(resultSetMapping);
    if (qrmd == null)
    {
      // TODO Localise this, and check if it is the correct exception to throw
      throw new IllegalArgumentException("ResultSetMapping " + resultSetMapping + " is not found");
    }
    internalQuery.setResultMetaData(qrmd);
    return new JPAQuery(this, internalQuery, QueryLanguage.SQL.toString());
  }
  catch (NucleusException ne)
  {
    throw new IllegalArgumentException(ne.getMessage(), ne);
  }
}

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

/**
 * Create an instance of Query for executing an SQL query.
 * @param sqlString a native SQL query string
 * @param resultSetMapping the name of the result set mapping
 * @return the new query instance
 */
public Query createNativeQuery(String sqlString, String resultSetMapping)
{
  assertIsOpen();
  try
  {
    org.datanucleus.store.query.Query jpoxQuery = getObjectManager().getOMFContext().getQueryManager().newQuery(
      QueryLanguage.SQL.toString(), getObjectManager(), sqlString);
    QueryResultMetaData qrmd = om.getMetaDataManager().getMetaDataForQueryResult(resultSetMapping);
    if (qrmd == null)
    {
      // TODO Localise this, and check if it is the correct exception to throw
      throw new IllegalArgumentException("ResultSetMapping " + resultSetMapping + " is not found");
    }
    jpoxQuery.setResultMetaData(qrmd);
    return new JPAQuery(this, jpoxQuery, QueryLanguage.SQL.toString());
  }
  catch (NucleusException jpe)
  {
    throw new IllegalArgumentException(jpe.getMessage(), jpe);
  }
}

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

internalQuery.setResultMetaData(qrmd);
return new JPAQuery(this, internalQuery, qmd.getLanguage());

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

jpoxQuery.setResultMetaData(qrmd);
return new JPAQuery(this, jpoxQuery, qmd.getLanguage());

相关文章