Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for 
change notification.

The following page has been changed by PeterMaloney:
http://wiki.apache.org/tapestry/Tapestry5HibernateGridDatasource3

------------------------------------------------------------------------------
- This example is an abstract class, which when extended can be used in a 
Tapestry 5 Grid component. It is compatible with any org.hibernate.Query 
object. Just create the java file with the following content, then extend it 
and implement createQuery(...) and createCountQuery(). Optionally use 
generateOrderBy(...) to generate an ORDER BY clause supporting any weird 
property mapping.
+ Grid datasource for hibernate queries. Abstract methods are used for creating 
a Query Object, so it is quite flexible; there is no requirement to use a DAO, 
HQL, or Criteria. It is compatible with any org.hibernate.Query object.
  
+ It was originally designed for use with HQL. It probably isn't as optimal for 
DaO as something specifically designed for that (unless your DaO object returns 
a org.hibernate.Query object).
+ 
+ To use it, extend it and implement createQuery(...) and createCountQuery(). 
Optionally use generateOrderBy(...) inside your createQuery(...) method to 
generate an ORDER BY clause supporting any weird property mapping.
+ 
+ It is intended to be extended for each page/component where it is used, and a 
new instance is created for each render. Theoretically, you could just call 
initAvailableRows() instead of creating a new one, or just remove the "if 
(this.rowCount == -1)" condition in getAvailableRows().
  
  
  
@@ -20, +25 @@

  
  /**
   * Grid datasource for hibernate queries. Abstract methods are used for 
creating
-  * a Query Object, so it is quite flexible; there is no requirement to use a 
DAO,
+  * a Query Object, so it is quite flexible; there is no requirement to use a
-  * HQL, or Criteria.
+  * DAO, HQL, or Criteria. It is compatible with any org.hibernate.Query 
object.<br>
+  * <br>
+  * It was originally designed for use with HQL. It probably isn't as optimal 
for
+  * DaO as something specifically designed for that (unless your DaO object
+  * returns a org.hibernate.Query object). <br>
+  * <br>
+  * To use it, extend it and implement createQuery(...) and createCountQuery().
+  * Optionally use generateOrderBy(...) inside your createQuery(...) method to
+  * generate an ORDER BY clause supporting any weird property mapping. <br>
+  * <br>
+  * It is intended to be extended for each page/component where it is used, 
and a
+  * new instance is created for each render. Theoretically, you could just call
+  * initAvailableRows() instead of creating a new one, or just remove the
+  * &quot;if (this.rowCount == -1)&quot; condition in getAvailableRows().<br>
+  * <br>
+  * Tested with Tapestry 5.0.11, JDK1.6
   * 
   * @author pmaloney, tli
-  * @version $Id: HibernateGridDataSource.java,v 1.6 2008/06/10 17:37:07 
pmaloney Exp $
+  * @version $Id: HibernateGridDataSource.java,v 1.6 2008/06/10 17:37:07 
pmaloney
+  *          Exp $
   */
  public abstract class HibernateGridDataSource implements GridDataSource {
      private static Category log = Category.getInstance( 
HibernateGridDataSource.class );
@@ -186, +207 @@

     
  }
  
- 
  }}}
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to