下面列出了怎么用org.hibernate.hql.internal.QueryExecutionRequestException的API类实例代码及写法,或者点击链接到github查看源代码。
static <T> T convertQueryException(T result, Throwable e,
AbstractProducedQuery<?> query) {
if ( e instanceof QueryExecutionRequestException) {
throw new IllegalStateException( e );
}
if ( e instanceof TypeMismatchException) {
throw new IllegalStateException( e );
}
if ( e instanceof HibernateException) {
throw query.getProducer().getExceptionConverter()
.convert( (HibernateException) e, query.getLockOptions() );
}
return CompletionStages.returnOrRethrow( e, result );
}
private void errorIfSelect() throws HibernateException {
if ( !getSqlAST().needsExecutor() ) {
throw new QueryExecutionRequestException( "Not supported for select queries", getQueryString() );
}
}
private void errorIfDML() throws HibernateException {
if ( sqlAst.needsExecutor() ) {
throw new QueryExecutionRequestException( "Not supported for DML operations", hql );
}
}
private void errorIfSelect() throws HibernateException {
if ( !sqlAst.needsExecutor() ) {
throw new QueryExecutionRequestException( "Not supported for select queries", hql );
}
}