Feed on
Posts
Comments

Archive for the ‘Hibernate’ Category

Hibernate Tutorial - 3

Cascading Persistence
We have said, a number of times, that when an object is made persistent, that the objects it refers to are also made persistent. This was an oversimplification. In the mapping files for the classes, there is an attribute, cascade that lets us control how much, or how little, of a reference graph [...]

Read Full Post »

Hibernate Tutorial - 2

Hibernate Objects
A Hibernate object, suitable for mapping into a database, is a normal java bean with a number of extra requirements.
There must be a default constructor for the class.
There must be accessors and mutators for all the instance variables of the class. Actually this is overstating the requirement but is a good base rule: [...]

Read Full Post »

Hibernate Tutorial - 1

Hibernate is an Object Relational Mapping (ORM) tool. It manages the persistence of java objects in a relational database. The idea is that a programmer should be able to design his business objects as standard Java objects with very little interference from the problems of making these objects persist in a database. Together with a [...]

Read Full Post »

Avoiding ORM Performance

Object Relational Mapping (ORM) libraries such as Hibernate and Toplink provide powerful tools for bridging the divide between your Java objects and their persistent representation in a relational database. By freeing you from the responsibility of handcrafting SQL and other data access code, ORM can provide a tremendous productivity boost for your project. But this [...]

Read Full Post »

Overview
If you do not use lazy associations, it is remarkably easy to unwittingly fall into the trap of executing many unnecessary SQL statements in your Hibernate applications. This pitfall shows how easily this problem can manifest itself, and how it can be overcome.

Read Full Post »

Overview
Using lazy initialization can help prevent unnecessary selects queries being executed when retrieving an object graph using HQL or Query by Criteria (QBC). However, to avoid the N+1 selects proble, the application developer needs to be careful to tune queries so that they match the way returned data is used in the application.

Read Full Post »

« Newer Posts