tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r958985 [29/29] - in /websites/production/tapestry/content: ./ 2009/09/13/ 2009/10/27/ 2009/11/25/ 2010/07/18/ 2010/07/24/ 2010/10/11/ 2010/10/31/ 2010/11/18/ 2010/12/16/ 2010/12/17/ 2011/01/18/ 2011/03/23/ 2011/03/29/ 2011/03/30/ 2011/03/3...
Date Sun, 19 Jul 2015 21:21:30 GMT
Modified: websites/production/tapestry/content/using-tapestry-with-hibernate.html
==============================================================================
--- websites/production/tapestry/content/using-tapestry-with-hibernate.html (original)
+++ websites/production/tapestry/content/using-tapestry-with-hibernate.html Sun Jul 19 21:21:27
2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css'
/>
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css'
/>
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -57,16 +67,8 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
-
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif"
width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using
BeanEditForm To Create User Forms</a>&#160;</td><td colspan="1" rowspan="1"
class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif"
width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry
Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;</td></tr></table></div><p>So,
you fill in all the fields, submit the form (without validation erro
 rs) and voila: you get back the same form, blanked out. What happened, and where did the
data go?</p><p>What happened is that we haven't told Tapestry what to do after
the form is successfully submitted (by successful, we mean, with no validation errors). Tapestry's
default behavior is to redisplay the active page, and that occurs in a new request, with a
new instance of the Address object (because the address field is not a peristent field).</p><p>Well,
since we're creating objects, we might as well store them somewhere ... in a database. We're
going to quickly integrate Tapestry with <a shape="rect" class="external-link" href="http://hibernate.org"
>Hibernate</a> as the object/relational mapping layer, and ultimately store our data
inside a <a shape="rect" class="external-link" href="http://www.hsqldb.org/" >HyperSQL</a>
(HSQLDB) database. HSQLDB is an embedded database engine and requires no installation &#8211;
it will be pulled down as a dependency by Maven.</p><h2 id="UsingTap
 estryWithHibernate-Re-configuringtheProject">Re-configuring the Project</h2><p>We're
going to bootstrap this project from a simple Tapestry project to one that uses Hibernate
and HSQLDB.</p><h3 id="UsingTapestryWithHibernate-UpdatingtheDependencies">Updating
the Dependencies</h3><p>First, we must update the POM to list a new set of dependencies,
that includes Hibernate, the Tapestry/Hibernate integration library, and the HSQLDB JDBC driver:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>src/pom.xml (partial)</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
   &lt;dependencies&gt;
+<div id="ConfluenceContent"><p>So, you fill in all the fields, submit the form
(without validation errors) and voila: you get back the same form, blanked out. What happened,
and where did the data go?</p><p>What happened is that we haven't told Tapestry
what to do after the form is successfully submitted (by successful, we mean, with no validation
errors). Tapestry's default behavior is to redisplay the active page, and that occurs in a
new request, with a new instance of the Address object (because the address field is not a
peristent field).</p><p>Well, since we're creating objects, we might as well store
them somewhere ... in a database. We're going to quickly integrate Tapestry with <a shape="rect"
class="external-link" href="http://hibernate.org" >Hibernate</a> as the object/relational
mapping layer, and ultimately store our data inside a <a shape="rect" class="external-link"
href="http://www.hsqldb.org/" >HyperSQL</a> (HSQLDB) database. HSQLDB is an embedded
database engine an
 d requires no installation &#8211; it will be pulled down as a dependency by Maven.</p><h2
id="UsingTapestryWithHibernate-Re-configuringtheProject">Re-configuring the Project</h2><p>We're
going to bootstrap this project from a simple Tapestry project to one that uses Hibernate
and HSQLDB.</p><h3 id="UsingTapestryWithHibernate-UpdatingtheDependencies">Updating
the Dependencies</h3><p>First, we must update the POM to list a new set of dependencies,
that includes Hibernate, the Tapestry/Hibernate integration library, and the HSQLDB JDBC driver:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>src/pom.xml (partial)</b></div><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">   
&lt;dependencies&gt;
 
         &lt;dependency&gt;
             &lt;groupId&gt;org.apache.tapestry&lt;/groupId&gt;
@@ -81,26 +83,26 @@ table.ScrollbarTable td.ScrollbarNextIco
         &lt;/dependency&gt;
         ...
     &lt;/dependencies&gt;
-]]></script>
+</pre>
 </div></div><p>The tapestry-hibernate library includes, as transitive dependencies,
Hibernate and tapestry-core. This means that you can simply replace "tapestry-core" with "tapestry-hibernate"
inside the &lt;artifactId&gt; element.</p><p>After changing the POM and
saving, Maven should automatically download the JARs for the new dependencies.</p><h3
id="UsingTapestryWithHibernate-HibernateConfiguration">Hibernate Configuration</h3><p>Hibernate
needs a master configuration file, hibernate.cfg.xml, used to store connection and other data.
Create this in your src/main/resources folder:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/hibernate.cfg.xml</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;!DOCTYPE
hibernate-configuration PUBLIC
-        &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
-        &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;!DOCTYPE
hibernate-configuration PUBLIC
+        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
 &lt;hibernate-configuration&gt;
     &lt;session-factory&gt;
-        &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;org.hsqldb.jdbcDriver&lt;/property&gt;
-        &lt;property name=&quot;hibernate.connection.url&quot;&gt;jdbc:hsqldb:./target/work/t5_tutorial1;shutdown=true&lt;/property&gt;
-        &lt;property name=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;
-        &lt;property name=&quot;hibernate.connection.username&quot;&gt;sa&lt;/property&gt;
-        &lt;property name=&quot;hibernate.connection.password&quot;&gt;&lt;/property&gt;
-        &lt;property name=&quot;hbm2ddl.auto&quot;&gt;update&lt;/property&gt;
-        &lt;property name=&quot;hibernate.show_sql&quot;&gt;true&lt;/property&gt;
-        &lt;property name=&quot;hibernate.format_sql&quot;&gt;true&lt;/property&gt;
+        &lt;property name="hibernate.connection.driver_class"&gt;org.hsqldb.jdbcDriver&lt;/property&gt;
+        &lt;property name="hibernate.connection.url"&gt;jdbc:hsqldb:./target/work/t5_tutorial1;shutdown=true&lt;/property&gt;
+        &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;
+        &lt;property name="hibernate.connection.username"&gt;sa&lt;/property&gt;
+        &lt;property name="hibernate.connection.password"&gt;&lt;/property&gt;
+        &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;
+        &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
+        &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
     &lt;/session-factory&gt;
 &lt;/hibernate-configuration&gt;
-]]></script>
+</pre>
 </div></div><p>Most of the configuration is to identify the JDBC driver
and connection URL.</p><p>Note the connection URL. We are instructing HSQLDB to
store its database files within our project's target directory. We are also instructing HSQLDB
to flush any data to these files at shutdown. This means that data will persist across different
invocations of this project, but if the target directory is destroyed (e.g., via "mvn clean"),
then all the database contents will be lost.</p><p>In addition, we are configuring
Hibernate to <em>update</em> the database schema; when Hibernate initializes it
will create or even modify tables to match the entities. Finally, we are configuring Hibernate
to output any SQL it executes, which is very useful when initially building an application.</p><p>But
what entities? Normally, the available entities are listed inside hibernate.cfg.xml, but that's
not necessary with Tapestry; in another example of convention over configuration, Tapestry
locates all
  entity classes inside the entities package ("com.example.tutorial.entities" in our case)
and adds them to the configuration. Currently, that is just the Address entity.</p><h2
id="UsingTapestryWithHibernate-AddingHibernateAnnotations">Adding Hibernate Annotations</h2><p>For
an entity class to be used with Hibernate, some Hibernate annotations must be added to the
class.</p><p>Below is the updated Address class, with the Hibernate annotations
(as well as the Tapestry ones).</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/entities/Address.java</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package
com.example.tutorial.entities;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package
com.example.tutorial.entities;
 
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -122,32 +124,32 @@ public class Address
 
   public Honorific honorific;
 
-  @Validate(&quot;required&quot;)
+  @Validate("required")
   public String firstName;
 
-  @Validate(&quot;required&quot;)
+  @Validate("required")
   public String lastName;
 
   public String street1;
 
   public String street2;
 
-  @Validate(&quot;required&quot;)
+  @Validate("required")
   public String city;
 
-  @Validate(&quot;required&quot;)
+  @Validate("required")
   public String state;
 
-  @Validate(&quot;required,regexp&quot;)
+  @Validate("required,regexp")
   public String zip;
 
   public String email;
 
   public String phone;
 }
-]]></script>
+</pre>
 </div></div><p>The Tapestry annotations, @NonVisual and @Validate, may
be placed on the setter or getter method or on the field (as we have done here). As with the
Hibernate annotations, putting the annotation on the field requires that the field name match
the corresponding property name.</p><ul><li><strong>@NonVisual</strong>
&#8211; indicates a field, such as a primary key, that should not be made visible to the
user.</li><li><strong>@Validate</strong> &#8211; identifies the
validations associated with a field.</li></ul><p>At this point you should
stop and restart your application.</p><h2 id="UsingTapestryWithHibernate-UpdatingtheDatabase">Updating
the Database</h2><p>So we have a database set up, and Hibernate is configured
to connect to it. Let's make use of that to store our Address object in the database.</p><p>What
we need is to provide some code to be executed when the form is submitted. When a Tapestry
form is submitted, there is a whole series of events that get fired. Th
 e event we are interested in is the "success" event, which comes late in the process, after
all the values have been pulled out of the request and applied to the page properties, and
after all server-side validations have occurred.</p><p>The success event is only
fired if there are no validation errors.</p><p>Our event handler must do two things:</p><ul><li>Use
the Hibernate Session object to persist the new Address object.</li><li>Commit
the transaction to force the data to be written to the database.</li></ul><p>Let's
update our CreateAddress.java class:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/address/CreateAddress.java</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package
com.example.tutorial.pages.address;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package
com.example.tutorial.pages.address;
 
 import com.example.tutorial.entities.Address;
 import com.example.tutorial.pages.Index;
@@ -176,13 +178,13 @@ public class CreateAddress
         return index;
     }
 }
-]]></script>
-</div></div><p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a>
annotation tells Tapestry to inject a service into the annotated field; Tapestry includes
a sophisticated Inversion of Control container (similar in many ways to Spring) that is very
good at locating available services by type, rather than by a string id. In any case, the
Hibernate Session object is exposed as a Tapestry IoC service, ready to be injected (this
is one of the things provided by the tapestry-hibernate module).</p><p>Tapestry
automatically starts a transaction as necessary; however that transaction will be <em>aborted</em>
at the end of the request by default. If we make changes to persistent objects, such as adding
a new Address object, then it is necessary to commit the transaction.</p><p>The
<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/hiber
 nate/annotations/CommitAfter.html">CommitAfter</a> annotation can be applied to
any component method; if the method completes normally, the transaction will be committed
(and a new transaction started to replace the committed transaction).</p><p>After
persisting the new address, we return to the main Index page of the application.</p><p><em>Note:
In real applications, it is rare to have pages and components directly use the Hibernate Session.
It is generally a better approach to define your own Data Access Object layer to perform common
update operations and queries.</em></p><h2 id="UsingTapestryWithHibernate-ShowingAddresses">Showing
Addresses</h2><p>As a little preview of what's next, let's display all the Addresses
entered by the user on the Index page of the application. After you enter a few names, it
will look something like:</p><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-content-image-border" src="using-tapestry-with-hibe
 rnate.data/index-grid-v1.png" data-image-src="/confluence/download/attachments/23340507/index-grid-v1.png?version=4&amp;modificationDate=1418482289000&amp;api=v2"
data-unresolved-comment-count="0" data-linked-resource-id="23527751" data-linked-resource-version="4"
data-linked-resource-type="attachment" data-linked-resource-default-alias="index-grid-v1.png"
data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png"
data-linked-resource-container-id="23340507" data-linked-resource-container-version="34"></span></p><h2
id="UsingTapestryWithHibernate-AddingtheGridtotheIndexpage">Adding the Grid to the Index
page</h2><p>So, how is this implemented? Primarily, its accomplished by the <a
shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">Grid</a>
component.</p><p>The Grid component is based on the same concepts as the BeanEditForm
component; it can pull apart a bean in
 to columns. The columns are sortable, and when there are more entries than will fit on a
single page, page navigation is automatically added.</p><p>A minimal Grid is very
easy to add to the template. Just add this near the bottom of Index.tml:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/Index.tml (partial)</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;t:grid source=&quot;addresses&quot;
-         include=&quot;honorific,firstName,lastName,street1,city,state,zip,phone&quot;/&gt;
-]]></script>
+</pre>
+</div></div><p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a>
annotation tells Tapestry to inject a service into the annotated field; Tapestry includes
a sophisticated Inversion of Control container (similar in many ways to Spring) that is very
good at locating available services by type, rather than by a string id. In any case, the
Hibernate Session object is exposed as a Tapestry IoC service, ready to be injected (this
is one of the things provided by the tapestry-hibernate module).</p><p>Tapestry
automatically starts a transaction as necessary; however that transaction will be <em>aborted</em>
at the end of the request by default. If we make changes to persistent objects, such as adding
a new Address object, then it is necessary to commit the transaction.</p><p>The
<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/hiber
 nate/annotations/CommitAfter.html">CommitAfter</a> annotation can be applied to
any component method; if the method completes normally, the transaction will be committed
(and a new transaction started to replace the committed transaction).</p><p>After
persisting the new address, we return to the main Index page of the application.</p><p><em>Note:
In real applications, it is rare to have pages and components directly use the Hibernate Session.
It is generally a better approach to define your own Data Access Object layer to perform common
update operations and queries.</em></p><h2 id="UsingTapestryWithHibernate-ShowingAddresses">Showing
Addresses</h2><p>As a little preview of what's next, let's display all the Addresses
entered by the user on the Index page of the application. After you enter a few names, it
will look something like:</p><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-content-image-border" src="using-tapestry-with-hibe
 rnate.data/index-grid-v1.png"></span></p><h2 id="UsingTapestryWithHibernate-AddingtheGridtotheIndexpage">Adding
the Grid to the Index page</h2><p>So, how is this implemented? Primarily, its
accomplished by the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">Grid</a>
component.</p><p>The Grid component is based on the same concepts as the BeanEditForm
component; it can pull apart a bean into columns. The columns are sortable, and when there
are more entries than will fit on a single page, page navigation is automatically added.</p><p>A
minimal Grid is very easy to add to the template. Just add this near the bottom of Index.tml:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/Index.tml (partial)</b></div><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">  &lt;t:grid
source="addresses"
+         include="honorific,firstName,lastName,street1,city,state,zip,phone"/&gt;
+</pre>
 </div></div><p>Note that the Grid component accepts many of the same parameters
that we used with the BeanEditForm. Here we use the include parameter to specify the properties
to show, and in what order.</p><p>Now all we have to do is supply the addresses
property in the Java code. Here's how Index.java should look now:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>src/main/java/com/example/tutorial/pages/Index.java</b></div><div
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package
com.example.tutorial.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package
com.example.tutorial.pages;
 import java.util.List;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.hibernate.Session;
@@ -196,16 +198,8 @@ public class Index
         return session.createCriteria(Address.class).list();
     }
 }
-]]></script>
-</div></div><p>Here, we're using the Hibernate Session object to find all
Address objects in the database. Any sorting that takes place will be done in memory. This
is fine for now (with only a handful of Address objects in the database). Later we'll see
how to optimize this for very large result sets.</p><h2 id="UsingTapestryWithHibernate-What'sNext?">What's
Next?</h2><p>We have lots more to talk about: more components, more customizations,
built-in Ajax support, more common design and implementation patterns, and even writing your
own components (which is easy!).</p><p>Check out the many Tapestry resources available
on the <a shape="rect" href="documentation.html">Documentation</a> page, including
the <a shape="rect" href="getting-started.html">Getting Started</a> and <a
shape="rect" href="frequently-asked-questions.html">FAQ</a> pages and the <a shape="rect"
href="cookbook.html">Cookbook</a>. Be sure to peruse the <a shape="rect" href="user-guide.html">User
Guide</a>, which provi
 des comprehensive details on nearly every Tapestry topic. Finally, be sure to visit (and
bookmark) <a shape="rect" class="external-link" href="http://jumpstart.doublenegative.com.au/jumpstart7/"
>Tapestry JumpStart</a>, which provides a nearly exhaustive set of tutorials.</p><style
type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
-
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif"
width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using
BeanEditForm To Create User Forms</a>&#160;</td><td colspan="1" rowspan="1"
class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif"
width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry
Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;</td></tr></table></div></div>
+</pre>
+</div></div><p>Here, we're using the Hibernate Session object to find all
Address objects in the database. Any sorting that takes place will be done in memory. This
is fine for now (with only a handful of Address objects in the database). Later we'll see
how to optimize this for very large result sets.</p><h2 id="UsingTapestryWithHibernate-What'sNext?">What's
Next?</h2><p>We have lots more to talk about: more components, more customizations,
built-in Ajax support, more common design and implementation patterns, and even writing your
own components (which is easy!).</p><p>Check out the many Tapestry resources available
on the <a shape="rect" href="documentation.html">Documentation</a> page, including
the <a shape="rect" href="getting-started.html">Getting Started</a> and <a
shape="rect" href="frequently-asked-questions.html">FAQ</a> pages and the <a shape="rect"
href="cookbook.html">Cookbook</a>. Be sure to peruse the <a shape="rect" href="user-guide.html">User
Guide</a>, which provi
 des comprehensive details on nearly every Tapestry topic. Finally, be sure to visit (and
bookmark) <a shape="rect" class="external-link" href="http://jumpstart.doublenegative.com.au/jumpstart7/"
>Tapestry JumpStart</a>, which provides a nearly exhaustive set of tutorials.</p></div>
 </div>
 
 <div class="clearer"></div>



Mime
View raw message