本文整理匯總了Java中org.hibernate.Query.setComment方法的典型用法代碼示例。如果您正苦於以下問題:Java Query.setComment方法的具體用法?Java Query.setComment怎麽用?Java Query.setComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.hibernate.Query
的用法示例。
在下文中一共展示了Query.setComment方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createQuery
import org.hibernate.Query; //導入方法依賴的package包/類
@Override
public Query createQuery(NamedQueryDefinition namedQueryDefinition) {
String queryString = namedQueryDefinition.getQueryString();
final Query query = new QueryImpl(
queryString,
namedQueryDefinition.getFlushMode(),
this,
getHQLQueryPlan( queryString, false ).getParameterMetadata()
);
query.setComment( "named HQL query " + namedQueryDefinition.getName() );
if ( namedQueryDefinition.getLockOptions() != null ) {
query.setLockOptions( namedQueryDefinition.getLockOptions() );
}
return query;
}
示例2: getNamedSQLQuery
import org.hibernate.Query; //導入方法依賴的package包/類
@Override
public Query getNamedSQLQuery(String queryName) throws MappingException {
errorIfClosed();
NamedSQLQueryDefinition nsqlqd = factory.getNamedSQLQuery( queryName );
if ( nsqlqd==null ) {
throw new MappingException( "Named SQL query not known: " + queryName );
}
Query query = new SQLQueryImpl(
nsqlqd,
this,
factory.getQueryPlanCache().getSQLParameterMetadata( nsqlqd.getQueryString() )
);
query.setComment( "named native SQL query " + queryName );
initQuery( query, nsqlqd );
return query;
}
示例3: initQuery
import org.hibernate.Query; //導入方法依賴的package包/類
private void initQuery(Query query, NamedQueryDefinition nqd) {
// todo : cacheable and readonly should be Boolean rather than boolean...
query.setCacheable( nqd.isCacheable() );
query.setCacheRegion( nqd.getCacheRegion() );
query.setReadOnly( nqd.isReadOnly() );
if ( nqd.getTimeout() != null ) {
query.setTimeout( nqd.getTimeout() );
}
if ( nqd.getFetchSize() != null ) {
query.setFetchSize( nqd.getFetchSize() );
}
if ( nqd.getCacheMode() != null ) {
query.setCacheMode( nqd.getCacheMode() );
}
if ( nqd.getComment() != null ) {
query.setComment( nqd.getComment() );
}
if ( nqd.getFirstResult() != null ) {
query.setFirstResult( nqd.getFirstResult() );
}
if ( nqd.getMaxResults() != null ) {
query.setMaxResults( nqd.getMaxResults() );
}
if ( nqd.getFlushMode() != null ) {
query.setFlushMode( nqd.getFlushMode() );
}
}