Tag Archives: HQL

Hibernate Fetch Lazy Child Entities with HQL and Native SQL

In one-to-many or many-to-many relationship, we often configure Hibernate to lazily fetch the children collection for performance reasons by reducing the database join operation and the amount of the data been pulled and transmitted from database to application. The application, … Continue reading

Posted in Database, Java | Tagged , , , , , , , , | Leave a comment

Use Hibernate Query Language to Join Tables and Map Column Values to Java Objects

The following example creates a HQL statement with named parameters, executes the query then maps the query result back to Java objects. The two named parameters in the example are accountNumber and trackingId. The three selected columns are unitPrice, qty … Continue reading

Posted in Database, Java | Tagged , | Leave a comment