We are currently writing an application that reads data from a source
database, transforms it, and loads it into a target database. We are
using Hibernate only for reading from the source database (Oracle 10g).
I'm primarily concerned with increasing our reading speed.
Here are a few characteristics of our app:
* The Hibernate mappings were generated using Hibernate's reverse
engineering tools. They are essentially unmodified.
* We generally read data only once, and then send it to the target
database. (Thus, I'm not sure if caching would be of great benefit.)
One of our very specific questions revolves around using join fetching.
We suspect that using join fetching will improve our speed by reducing
the number of queries. We had been using HQL queries, but we are now
migrating some of these to Criteria queries. This is because, based on
our current understanding, we must use Criteria queries in order to
achieve join fetching.
When we use HQL queries, we consistently set
org.hibernate.SQLQuery.setReadOnly(true). However, I do not know how to
achieve the same effect when using Criteria queries.
In summary, I'm wondering how to use join fetching while maintaining the
setReadOnly(true) behavior.
Can you help us with this problem?
|