Hibernate - Fetching strategies

30 August 2008

Hibernate uses fetching strategy for retrieving associated objects when an application needs to navigate the association. Fetch strategies are declared in the object relational mapping metadata, or over-ridden by a particular HQL or Criteria query.

Hibernate defines following fetching strategies:

- Join fetching is used to retrieve the associated instance or collection in the same SELECT, using an OUTER JOIN.

- Select fetching is used to retrieve the associated entity or collection. Unless you explicitly disable lazy fetching by specifying lazy=”false”, this second select will only be executed when you actually access the association.

- Subselect fetching is used to retrieve the associated collections for all entities retrieved in a previous query or fetch. Unless you explicitly disable lazy fetching by specifying lazy=”false”, this second select will only be executed when you actually access the association.

- Batch fetching is an optimization strategy for select fetching. It retrieves a batch of entity instances or collections in a single SELECT, by specifying a list of primary keys or foreign keys.

del.icio.us:Hibernate - Fetching strategies  digg:Hibernate - Fetching strategies  spurl:Hibernate - Fetching strategies  wists:Hibernate - Fetching strategies  simpy:Hibernate - Fetching strategies  newsvine:Hibernate - Fetching strategies  blinklist:Hibernate - Fetching strategies  furl:Hibernate - Fetching strategies  reddit:Hibernate - Fetching strategies  fark:Hibernate - Fetching strategies  blogmarks:Hibernate - Fetching strategies  Y!:Hibernate - Fetching strategies  smarking:Hibernate - Fetching strategies  magnolia:Hibernate - Fetching strategies  segnalo:Hibernate - Fetching strategies  gifttagging:Hibernate - Fetching strategies

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Hibernate - Fetching strategies

Leave a Reply