1

I am generating a report using Hibernate.

Below is the sample code: Query query = session.createSQLQuery("select * from A, B where A.id= B.Val"); ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);

I want to know all the column names and column types before generating an Excel report.

How to achieve this with Hibernate scrollable results?

Can anyone please help me on this.

Karthik
  • 11
  • 1

1 Answers1

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

Garreth Golding
  • 985
  • 2
  • 11
  • 19