tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r988098 - in /websites/production/tapestry/content: cache/main.pageCache persistent-page-data.html
Date Fri, 13 May 2016 00:19:32 GMT
Author: buildbot
Date: Fri May 13 00:19:32 2016
New Revision: 988098

Log:
Production update by buildbot for tapestry

Modified:
    websites/production/tapestry/content/cache/main.pageCache
    websites/production/tapestry/content/persistent-page-data.html

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/tapestry/content/persistent-page-data.html
==============================================================================
--- websites/production/tapestry/content/persistent-page-data.html (original)
+++ websites/production/tapestry/content/persistent-page-data.html Fri May 13 00:19:32 2016
@@ -127,10 +127,10 @@
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @Persist(PersistenceConstants.CLIENT)
   private int value;
 </pre>
-</div></div><h3 id="PersistentPageData-HibernateEntityStrategy">Hibernate
Entity Strategy</h3><p><span style="line-height: 1.4285715;">Entity persistence
is provided by either the tapestry-hibernate modules (which extend Tapestry with new features).</span></p><p>In
Entity persistence, the field should store a Hibernate entity instance.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>"Hibernate Entity Strategy"</b></div><div class="codeContent
panelContent pdl">
+</div></div><h3 id="PersistentPageData-HibernateEntityStrategy">Hibernate
Entity Strategy</h3><p><span style="line-height: 1.4285715;">Entity persistence
is provided by the tapestry-hibernate module (which extends Tapestry with new features).</span></p><p>In
Entity persistence, the field should store a Hibernate entity instance.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>"Hibernate Entity Strategy"</b></div><div class="codeContent
panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @Persist(HibernatePersistenceConstants.ENTITY)
   private User user;</pre>
-</div></div><p>&#160;</p><p>The value stored in the HttpSession
is a&#160;<em>token</em> for the entity: its Java class name and primary key.
When the field is restored in a later request, the entity is re-instantiated using that data.</p><p>What
is&#160;<em>not</em> stored is any changes to the persistent entity that are
not committed to the external datastore (the database).</p><p>Starting in Tapestry
5.4, it is possible to store a non-persistent entity (a transient entity). A transient entity
is stored directly into the HttpSession, and should be Serializable if the application is
clustered.</p><h3 id="PersistentPageData-JPAEntityStrategy">JPA Entity Strategy</h3><p>The
tapestry-jpa module introduces a similar strategy (also with the name "entity"). However,
at the current time it may only store a persisted entity (one that has been saved to the database
and has a primary key).</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style
 ="border-bottom-width: 1px;"><b>"Example: JPA Entity Strategy"</b></div><div
class="codeContent panelContent pdl">
+</div></div><p>&#160;</p><p>The value stored in the HttpSession
is a&#160;<em>token</em> for the entity: its Java class name and primary key.
When the field is restored in a later request, the entity is re-instantiated using that data.</p><p>What
is&#160;<em>not</em> stored is any changes to the persistent entity that are
not committed to the external datastore (the database).</p><p>Starting in Tapestry
5.4, it is possible to store a non-persistent entity (a transient entity). A transient entity
is stored directly into the HttpSession, and should be Serializable if the application is
clustered.</p><h3 id="PersistentPageData-JPAEntityStrategy">JPA Entity Strategy</h3><p>The
tapestry-jpa module uses a similar strategy. However, at the current time it can only store
a persisted entity (one that has been saved to the database and has a primary key).</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>"Exa
 mple: JPA Entity Strategy"</b></div><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @Persist(JpaPersistenceConstants.ENTITY)
   private Account account;</pre>
 </div></div><p><span style="color: rgb(83,145,38);font-size: 20.0px;line-height:
1.5;">Persistence Strategy Inheritance</span></p><p>By default the value
for the Persist annotation is the empty string. When this is true, then the actual strategy
to be used is determined by a search up the component hierarchy.</p><p>For each
component, the meta-data property <code>tapestry.persistence-strategy</code> is
checked. This can be specified using the <a  class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Meta.html">Meta</a>
annotation.</p><p>If the value is non-blank, then that strategy is used. This
allows a component to control the persistence strategy used inside any sub-components (that
don't explicitly use a different strategy).</p><p>In any case, if no component
provides the meta data, then the ultimate default, "session", is used.</p><h2 id="PersistentPageData-DefaultValues">Default
Values</h2><p>Fields marked with @Persist may not
  have default values (whether set inline, or inside a constructor).</p><h2 id="PersistentPageData-ClearingPersistentFields">Clearing
Persistent Fields</h2><p>If you reach a point where you know that all data for
a page can be discarded, you can do exactly that.</p><p>The method <code>discardPersistentFieldChanges()</code>
of ComponentResources will discard all persistent fields for the page, regardless of which
strategy is used to store the property. This will not affect the page in memory, but takes
effect for subsequent requests.</p><p></p><h2 id="PersistentPageData-ClusteringIssues">Clustering
Issues</h2>



Mime
View raw message