org.openfaces.component.filter
Class HibernateCriterionBuilder

java.lang.Object
  extended by org.openfaces.component.filter.FilterCriterionProcessor
      extended by org.openfaces.component.filter.HibernateCriterionBuilder

public class HibernateCriterionBuilder
extends FilterCriterionProcessor


Constructor Summary
HibernateCriterionBuilder()
           
 
Method Summary
static org.hibernate.criterion.Criterion build(FilterCriterion filterCriterion)
          Returns hibernate Criterion instance that corresponds to the passed FilterCriterion instance.
static org.hibernate.Criteria buildCriteria(org.hibernate.Session session, java.lang.Class persistentClass)
          You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.
static org.hibernate.Criteria buildCriteria(org.hibernate.Session session, java.lang.Class persistentClass, java.lang.String alias)
          You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.
static org.hibernate.Criteria buildCriteria(org.hibernate.Session session, java.lang.String entityName)
          You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.
static org.hibernate.Criteria buildCriteria(org.hibernate.Session session, java.lang.String entityName, java.lang.String alias)
          You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.
static void fillCriteria(org.hibernate.Criteria criteria)
          You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.
static HibernateCriterionBuilder getInstance()
          Returns an instance of the HibernateCriterionBuilder class, which is used by the build method internally.
static int getRowCount(org.hibernate.Criteria criteria)
          This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.
static int getRowCount(org.hibernate.Session session, java.lang.Class persistentClass)
          This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.
static int getRowCount(org.hibernate.Session session, java.lang.Class persistentClass, java.lang.String alias)
          This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.
static int getRowCount(org.hibernate.Session session, java.lang.String entityName)
          This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.
static int getRowCount(org.hibernate.Session session, java.lang.String entityName, java.lang.String alias)
          This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.
 java.lang.Object process(AndFilterCriterion criterion)
          Used by the build method internally.
 java.lang.Object process(ExpressionFilterCriterion criterion)
          Used by the build method internally.
 java.lang.Object process(OrFilterCriterion criterion)
          Used by the build method internally.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateCriterionBuilder

public HibernateCriterionBuilder()
Method Detail

build

public static org.hibernate.criterion.Criterion build(FilterCriterion filterCriterion)
Returns hibernate Criterion instance that corresponds to the passed FilterCriterion instance.


buildCriteria

public static org.hibernate.Criteria buildCriteria(org.hibernate.Session session,
                                                   java.lang.Class persistentClass)
You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.

This method creates the hibernate Criteria object with the current DataTable custom data providing parameters that are automatically retrieved from the request scope by this method. That is the returned Criteria will contain the current table's filtering, sorting and pagination parameters.

NOTE: the table should have the "id" attribute specified for all sortable columns. The id value should correspond to the appropriate property name by which sorting should be performed, or more formally, the value of the "id" attribute will be passed to the Order.asc(String propertyName) and Order.desc(String propertyName) methods when populating the Criteria object.

You can use any of the buidCriteria() methods or the fillCriteria() method depending on the needs of your application.

See Also:
@fillCriteria

buildCriteria

public static org.hibernate.Criteria buildCriteria(org.hibernate.Session session,
                                                   java.lang.String entityName)
You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.

This method creates the hibernate Criteria object with the current DataTable custom data providing parameters that are automatically retrieved from the request scope by this method. That is the returned Criteria will contain the current table's filtering, sorting and pagination parameters.

NOTE: the table should have the "id" attribute specified for all sortable columns. The id value should correspond to the appropriate property name by which sorting should be performed, or more formally, the value of the "id" attribute will be passed to the Order.asc(String propertyName) and Order.desc(String propertyName) methods when populating the Criteria object.

You can use any of the buidCriteria() methods or the fillCriteria() method depending on the needs of your application.

See Also:
@fillCriteria

buildCriteria

public static org.hibernate.Criteria buildCriteria(org.hibernate.Session session,
                                                   java.lang.Class persistentClass,
                                                   java.lang.String alias)
You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.

This method creates the hibernate Criteria object with the current DataTable custom data providing parameters that are automatically retrieved from the request scope by this method. That is the returned Criteria will contain the current table's filtering, sorting and pagination parameters.

NOTE: the table should have the "id" attribute specified for all sortable columns. The id value should correspond to the appropriate property name by which sorting should be performed, or more formally, the value of the "id" attribute will be passed to the Order.asc(String propertyName) and Order.desc(String propertyName) methods when populating the Criteria object.

You can use any of the buidCriteria() methods or the fillCriteria() method depending on the needs of your application.

See Also:
@fillCriteria

buildCriteria

public static org.hibernate.Criteria buildCriteria(org.hibernate.Session session,
                                                   java.lang.String entityName,
                                                   java.lang.String alias)
You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.

This method creates the hibernate Criteria object with the current DataTable custom data providing parameters that are automatically retrieved from the request scope by this method. That is the returned Criteria will contain the current table's filtering, sorting and pagination parameters.

NOTE: the table should have the "id" attribute specified for all sortable columns. The id value should correspond to the appropriate property name by which sorting should be performed, or more formally, the value of the "id" attribute will be passed to the Order.asc(String propertyName) and Order.desc(String propertyName) methods when populating the Criteria object.

You can use any of the buidCriteria() methods or the fillCriteria() method depending on the needs of your application.

See Also:
@fillCriteria

fillCriteria

public static void fillCriteria(org.hibernate.Criteria criteria)
You can invoke this function from the DataTable's data providing method (a method that is bound to the DataTable's "value" attribute) to implement the hibernate-based custom data providing mode.

This method fills the passed hibernate Criteria object with the current DataTable custom data providing parameters that are automatically retrieved from the request scope by this method. That is the Criteria object will be configured with the current table's filtering, sorting and pagination parameters.

NOTE: the table should have the "id" attribute specified for all sortable columns. The id value should correspond to the appropriate property name by which sorting should be performed, or more formally, the value of the "id" attribute will be passed to the Order.asc(String propertyName) and Order.desc(String propertyName) methods when populating the Criteria object.

You can use any of the buidCriteria() methods or the fillCriteria() method depending on the needs of your application.

See Also:
@buildCriteria

getRowCount

public static int getRowCount(org.hibernate.Session session,
                              java.lang.String entityName)
This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.

Returns:
the total number of rows without the pagination parameters (which is required by DataTable to properly calculate the number of pages).

getRowCount

public static int getRowCount(org.hibernate.Session session,
                              java.lang.Class persistentClass)
This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.

Returns:
the total number of rows without the pagination parameters (which is required by DataTable to properly calculate the number of pages).

getRowCount

public static int getRowCount(org.hibernate.Session session,
                              java.lang.String entityName,
                              java.lang.String alias)
This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.

Returns:
the total number of rows without the pagination parameters (which is required by DataTable to properly calculate the number of pages).

getRowCount

public static int getRowCount(org.hibernate.Session session,
                              java.lang.Class persistentClass,
                              java.lang.String alias)
This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.

Returns:
the total number of rows without the pagination parameters (which is required by DataTable to properly calculate the number of pages).

getRowCount

public static int getRowCount(org.hibernate.Criteria criteria)
This method should be invoked from a method bound to the DataTable's "totalRowCount" attribute to implement the hibernate-based custom data providing mode.

Returns:
the total number of rows without the pagination parameters (which is required by DataTable to properly calculate the number of pages).

getInstance

public static HibernateCriterionBuilder getInstance()
Returns an instance of the HibernateCriterionBuilder class, which is used by the build method internally. This method shouldn't normally be invoked by application developers.


process

public java.lang.Object process(ExpressionFilterCriterion criterion)
Used by the build method internally. This method shouldn't normally be invoked by application developers.

Specified by:
process in class FilterCriterionProcessor

process

public java.lang.Object process(AndFilterCriterion criterion)
Used by the build method internally. This method shouldn't normally be invoked by application developers.

Specified by:
process in class FilterCriterionProcessor

process

public java.lang.Object process(OrFilterCriterion criterion)
Used by the build method internally. This method shouldn't normally be invoked by application developers.

Specified by:
process in class FilterCriterionProcessor


Copyright © 1998-2010 TeamDev Ltd. All Rights Reserved.