Return-Path: Delivered-To: apmail-cocoon-docs-archive@www.apache.org Received: (qmail 90390 invoked from network); 29 Oct 2004 20:18:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Oct 2004 20:18:52 -0000 Received: (qmail 58749 invoked by uid 500); 29 Oct 2004 20:18:51 -0000 Delivered-To: apmail-cocoon-docs-archive@cocoon.apache.org Received: (qmail 58696 invoked by uid 500); 29 Oct 2004 20:18:50 -0000 Mailing-List: contact docs-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: docs@cocoon.apache.org Delivered-To: mailing list docs@cocoon.apache.org Received: (qmail 58640 invoked by uid 99); 29 Oct 2004 20:18:50 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 29 Oct 2004 13:18:46 -0700 Received: (qmail 90003 invoked from network); 29 Oct 2004 20:18:45 -0000 Received: from unknown (HELO minotaur.apache.org) (127.0.0.1) by 127.0.0.1 with SMTP; 29 Oct 2004 20:18:45 -0000 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: docs@cocoon.apache.org To: docs@cocoon.apache.org Subject: =?iso-8859-1?q?=5BCocoon_Wiki=5D_Updated=3A__GettingStartedWithCocoonAndH?= =?iso-8859-1?q?ibernate?= Date: Fri, 29 Oct 2004 20:18:45 -0000 Message-ID: <20041029201845.89975.93096@minotaur.apache.org> X-Spam-Rating: 127.0.0.1 1.6.2 0/1000/N X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Date: 2004-10-29T13:18:45 Editor: JorgHeymans Wiki: Cocoon Wiki Page: GettingStartedWithCocoonAndHibernate URL: http://wiki.apache.org/cocoon/GettingStartedWithCocoonAndHibernate no comment Change Log: ---------------------------------------------------------------------------= --- @@ -1,12 +1,16 @@ - =3D Why would you want to do this? =3D = -''brief outline of the benefits of using Hibernate'' - +''brief outline of the benefits of using an object relational mapping tool= , like for Hibernate or OJB'' + * You don't have to write endless SQL access code anymore. The O/R mapp= ing tool generates all necessary SQL access code behind the scenes and hand= s you the results in POJO format. + * You can manipulate your database (read, insert, delete) using POJO's = and nothing but POJO's. + * Hibernate comes with transparent connection pooling (DBCP) and query = caching (EHCache), only a matter of configuration. = =3D What must you know before you start? =3D = ''outline skills and depth of knowledge required'' + * You need to be proficient in Java, have basic SQL knowledge in case y= ou want to do troubleshooting. = + * You should now how to translate your application domain into a solid = database model. + * Understand the "lazy loading" concept that most O/R mapping tools use= by default. This generally means that nothing is retrieved from the databa= se until you really ask for it. [http://www.hibernate.org/162.html] = ''outline skills and depth of knowledge that would be useful'' = @@ -22,23 +26,28 @@ = =3D What other software is also useful? =3D = -=3D=3D System X =3D=3D +=3D=3D Random query monitoring tool =3D=3D + +It is useful to see what queries your mapping tool is actually generating = under the hood. With hibernate you can configure this in the configuration = file. Alternatively most databases also offer query logging. = -System X is useful because .... It can be obtained from [http://www] +=3D=3D Middlegen =3D=3D = -=3D=3D System Y =3D=3D +Middlegen extracts hibernate mapping files from your database. It also cor= rectly generates the mapping relations between tables if you setup foreign = key constraints. = = -System Y is useful because .... It can be obtained from [http://www] +It can be obtained from [http://boss.bekk.no/boss/middlegen/], check also = [http://middlegen.codehaus.org/] or [http://www.hibernate.org/98.html] = = -=3D=3D System Z =3D=3D +=3D=3D hbm2java =3D=3D = -System Z is useful because .... It can be obtained from [http://www] +hbm2java is a hibernate ant task that can generate java classes from hiber= nate mapping files. It can be obtained from the hibernate distribution [htt= p://www.hibernate.org] = ---- = =3D How to Install and Configure the Software =3D = -Hibernate can be deployed according to the installation procedure found at= [http://www.hibernate.org/]. After this you will need to... +Hibernate can be deployed according to the installation procedure found at= [http://www.hibernate.org/]. = + + * If you want to setup hibernate under Cocoon I recommend you setup a s= ervlet filter for handling the disposal of hibernate sessions. This ensures= that your hibernate session sticks around until *after* your view was rend= ered. This technique is described in more detail in the "Hibernate in Actio= n" book ([http://www.manning.com/bauer]). = + = Other installation procedures needed before getting started are ... = @@ -48,7 +57,7 @@ = =3D=3D Objective =3D=3D = -The objective of this part is to allow a user to perform an ACID (add/crea= te/insert/delete) operation on a single table. The table, while simple, co= ntains a range of data types that will demonstrate how data is formatted in= the front end (by Cocoon) and handled on the back end (by Hibernate). In = addition ... +The objective of this part is to allow a user to perform an ACID (add/crea= te/insert/delete) operation on a single table. The table, while simple, co= ntains a range of data types that will demonstrate how data is formatted in= the front end (by Cocoon) and handled on the back end (by Hibernate). = = =3D=3D Step 1: Do this =3D=3D =20