本文整理了Java中org.datanucleus.store.query.Query.setResultClass
方法的一些代码示例,展示了Query.setResultClass
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setResultClass
方法的具体详情如下:
包路径:org.datanucleus.store.query.Query
类名称:Query
方法名:setResultClass
暂无
代码示例来源:origin: org.datanucleus/datanucleus-jpa
/**
* Convenience method to allow setting of the result class of the internal query.
* @param resultClass The result class
* @return This query
*/
JPAQuery<X> setResultClass(Class resultClass)
{
query.setResultClass(resultClass);
return this;
}
代码示例来源:origin: org.datanucleus/datanucleus-rdbms
/**
* Method to set the MetaData defining the result.
* Setting this will unset the resultClass.
* @param qrmd Query Result MetaData
*/
public void setResultMetaData(QueryResultMetaData qrmd)
{
this.resultMetaData = qrmd;
super.setResultClass(null);
}
代码示例来源:origin: org.datanucleus/datanucleus-rdbms
/**
* Set the result class for the results.
* Setting this will unset the resultMetaData.
* @param result_cls The result class
*/
public void setResultClass(Class result_cls)
{
super.setResultClass(result_cls);
this.resultMetaData = null;
}
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
/**
* Set the result class for the query.
* @param result_cls Result class
*/
public void setResultClass(Class result_cls)
{
assertIsOpen();
try
{
query.setResultClass(result_cls);
}
catch (NucleusException jpe)
{
throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
}
}
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
@Override
public <R> List<R> executeResultList(Class<R> resultCls)
{
assertIsOpen();
if (resultCls == null)
{
throw new JDOUserException("Result Class must be specified");
}
this.query.setResultClass(resultCls);
return (List<R>) executeInternal();
}
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
@Override
public <R> R executeResultUnique(Class<R> resultCls)
{
assertIsOpen();
query.setUnique(true);
if (resultCls == null)
{
throw new JDOUserException("Result Class must be specified");
}
this.query.setResultClass(resultCls);
return (R) executeInternal();
}
代码示例来源:origin: forcedotcom/java-sdk
/**
* Create an instance of Query for executing an SOQL query.
* @param soqlString a native SOQL query string
* @param resultClass the class of the resulting instance(s)
* @return the new query instance
*/
@Override
public Query createNativeQuery(String soqlString, Class resultClass) {
assertIsOpen();
try {
org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
SOQL_LANGUAGE, om.getExecutionContext(), soqlString);
if (resultClass != null) {
internalQuery.setResultClass(resultClass);
}
return new JPAQuery(this, internalQuery, SOQL_LANGUAGE);
} catch (NucleusException ne) {
throw new IllegalArgumentException(ne.getMessage(), ne);
}
}
代码示例来源:origin: com.force.sdk/force-jpa
/**
* Create an instance of Query for executing an SOQL query.
* @param soqlString a native SOQL query string
* @param resultClass the class of the resulting instance(s)
* @return the new query instance
*/
@Override
public Query createNativeQuery(String soqlString, Class resultClass) {
assertIsOpen();
try {
org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
SOQL_LANGUAGE, om.getExecutionContext(), soqlString);
if (resultClass != null) {
internalQuery.setResultClass(resultClass);
}
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 resultClass the class of the resulting instance(s)
* @return the new query instance
*/
public Query createNativeQuery(String sqlString, Class resultClass)
{
assertIsOpen();
try
{
org.datanucleus.store.query.Query internalQuery = om.getOMFContext().getQueryManager().newQuery(
QueryLanguage.SQL.toString(), om.getExecutionContext(), sqlString);
if (resultClass != null)
{
internalQuery.setResultClass(resultClass);
}
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 resultClass the class of the resulting instance(s)
* @return the new query instance
*/
public Query createNativeQuery(String sqlString, Class resultClass)
{
assertIsOpen();
try
{
org.datanucleus.store.query.Query jpoxQuery = getObjectManager().getOMFContext().getQueryManager().newQuery(
QueryLanguage.SQL.toString(), getObjectManager(), sqlString);
jpoxQuery.setResultClass(resultClass);
return new JPAQuery(this, jpoxQuery, QueryLanguage.SQL.toString());
}
catch (NucleusException jpe)
{
throw new IllegalArgumentException(jpe.getMessage(), jpe);
}
}
代码示例来源:origin: org.datanucleus/datanucleus-jpa
internalQuery.setResultClass(resultClass);
return new JPAQuery(this, internalQuery, qmd.getLanguage());
代码示例来源:origin: org.datanucleus/datanucleus-java5
jpoxQuery.setResultClass(resultClass);
return new JPAQuery(this, jpoxQuery, qmd.getLanguage());
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
internalQuery.setResultClass(resultClass);
internalQuery.setUnique(unique);
if (candidates != null)
内容来源于网络,如有侵权,请联系作者删除!