Reputation: 22347
Given this example:
NativeQuery query = query();
try ( ScrollableResults scroll = query.scroll(ScrollMode.FORWARD_ONLY) ) {
int i = -1; while ( scroll.next() ) {
++i; // DO SOMETHING
}
}
When I do scroll.next() i can do scroll.get(i)
;
However, I can not see a way to get the column name that you normally get on a select. Normally you would on a ResultSet
get the columName
for i
.
On that class is getResultSet() but is private which would have allowed:
scroll.getResultSet().getMetaData().getColumnName(i)
But is now not possible, and not pretty even if it was.
Upvotes: 1
Views: 400
Reputation: 16400
If you work with a native query, why don't you use the JDBC API directly?
session.doWork(new Work() {
@Override
public void execute(Connection connection) throws SQLException {
}
});
Like suggested in your similar question here: hibernate get underlying sql resutlset. nativequery is very limiting
Upvotes: 2