休眠获取基础的SQL resutlset.nativequery非常有局限性 [英] hibernate get underlying sql resutlset. nativequery is very limiting

查看:54
本文介绍了休眠获取基础的SQL resutlset.nativequery非常有局限性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hibernate获取基础的SQL resutlset.nativequery是非常有限的.我需要执行常规的sql查询,同时能够访问结果集.

hibernate get underlying sql resutlset. nativequery is very limiting. i need to execute a regular sql query while being able to access the resultset.

org.hibernate.internal.ScrollableResultsImpl 已保护对 getResultSet 的访问.我如何提供自己的实现,将暴露 resultset .

org.hibernate.internal.ScrollableResultsImpl has protected access on getResultSet. how can i provide my own implementation that will expose resultset.

我简直不敢相信他们让这件事变得困难了.

i can't believe they've made this f*** hard.

我需要一个结果集才能获取诸如列名之类的元数据.他们在那里.

I need a resultset to be able to get the metadata such as column names. they are there.

推荐答案

您可以直接在基础 Connection 上进行操作,而无需借助本机查询:

You can operate on the underlying Connection directly, without resorting to a native query:

session.doWork(new Work() {
    @Override
    public void execute(Connection connection) throws SQLException {
    }
});

这篇关于休眠获取基础的SQL resutlset.nativequery非常有局限性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆