From hibernate-commits at lists.jboss.org Thu Nov 30 17:12:54 2006 Content-Type: multipart/mixed; boundary="===============7684888920486413472==" MIME-Version: 1.0 From: hibernate-commits at lists.jboss.org To: hibernate-commits at lists.jboss.org Subject: [hibernate-commits] Hibernate SVN: r10903 - branches/Branch_3_2/HibernateExt/metadata/doc/reference/en/modules Date: Thu, 30 Nov 2006 17:12:54 -0500 Message-ID: --===============7684888920486413472== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: epbernard Date: 2006-11-30 17:12:54 -0500 (Thu, 30 Nov 2006) New Revision: 10903 Modified: branches/Branch_3_2/HibernateExt/metadata/doc/reference/en/modules/entit= y.xml Log: ANN-430 refine donc on LAZY/EAGER Modified: branches/Branch_3_2/HibernateExt/metadata/doc/reference/en/module= s/entity.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/Branch_3_2/HibernateExt/metadata/doc/reference/en/modules/enti= ty.xml 2006-11-30 21:54:27 UTC (rev 10902) +++ branches/Branch_3_2/HibernateExt/metadata/doc/reference/en/modules/enti= ty.xml 2006-11-30 22:12:54 UTC (rev 10903) @@ -1700,7 +1700,7 @@ more information on cascading and create/merge semantics. = - + Association fetching = You have the ability to either eagerly or lazily fetch @@ -1708,11 +1708,20 @@ to FetchType.LAZY or FetchType.EAGER. EAGER will = try to use an outer join select to retrieve the associated object, whi= le - LAZY is the default and will only trigger a sel= ect - when the associated object is accessed for the first time. EJBQL a= lso - has a fetch keyword that allows you to override - laziness when doing a particular query. This is very useful to imp= rove - performance and is decided on a use case to use case basis. + LAZY will only trigger a select when the associ= ated + object is accessed for the first time. @OneToMany + and @ManyToMany associations are defaulted to + LAZY and @OneToOne and + @ManyToOne are defaulted to + EAGER. For more information about static fetchi= ng, + check . + + The recommanded approach is to use LAZY o= nn + all static fetching definitions and override this choice dynamical= ly + through JPA-QL. JPA-QL has a fetch keyword that + allows you to override laziness when doing a particular query. Thi= s is + very useful to improve performance and is decided on a use case to= use + case basis. = @@ -2693,7 +2702,8 @@ = alter table Child add constraint FK_PARENT foreign key (parent_id) referen= ces Parent = - + Lazy options and fetching modes = EJB3 comes with the fetch option to define @@ -2806,7 +2816,7 @@ = - the where clause, using @Where (applied on the target entit= y) or @WhereJoinTable (applied on the association table) + the where clause, using @Where (applied on the target entit= y) or @WhereJoinTable (applied on the association table) = = --===============7684888920486413472==--