Hello:
Pardon me if it has been answered before but I could not find
via different searches on Hibernate or Google.
createSQLQuery("select * from A,B where <condition>").iterate()
to get earch row and do processing.
the doc says the above returns Object[], which is great
except that I need to know their column names, which
it would not be practically to use hardcoded mapping of
array index to column names. In other words, how to get
the ResultSetMetaData. Or is there a way to return
a Map<String,String> that the key would be the column name.
I wonder how to get the info within hibernate. I could
get a jdbc connection and do the old jdbc way, but it would
lose the advantage of using hibernate, such as builtin handling
of prepared statements, etc.
Another related question is that would iterate() first creates
the whole list from db and then return the iterator or it would
be a reference to the incoming result sets so that large data
set would not fill the memory.
Thanks in advance.
|