1

我正在使用 Hibernate 生成报告。

下面是示例代码: Query query = session.createSQLQuery("select * from A, B where A.id= B.Val"); ScrollableResults 结果 = query.scroll(ScrollMode.FORWARD_ONLY);

在生成 Excel 报告之前,我想知道所有列名和列类型。

如何使用 Hibernate 可滚动结果来实现这一点?

谁能帮我解决这个问题。

4

1 回答 1

1

If you look at the ScrollableResults interface you'll see it has a method getType which returns the Hibernate Type of the given column. For example Type could be a StringType which maps to VARCHAR

于 2018-07-10T16:18:26.257 回答