info.joseluismartin.dao.hibernate
Class AbstractCriteriaBuilder

java.lang.Object
  extended by info.joseluismartin.dao.hibernate.AbstractCriteriaBuilder
All Implemented Interfaces:
CriteriaBuilder

public abstract class AbstractCriteriaBuilder
extends Object
implements CriteriaBuilder

Base class for CriteriaBuilders, add some utility methods.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Constructor Summary
AbstractCriteriaBuilder()
           
 
Method Summary
abstract  Criteria build(Criteria criteria, Object filter)
          Add Restrictions to Critera from filter
protected  void eq(Criteria criteria, String property, Object value)
          Add a '=' Restriction on property
protected  void ge(Criteria criteria, String property, Object value)
          Add a '>=' Restriction on property
protected  void le(Criteria criteria, String property, Object value)
          Add a '<=' Restriction on property
protected  void like(Criteria criteria, String property, String value)
          Add a ilike Restriction adding wrapping value on '%' and replacing '*' for '%'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCriteriaBuilder

public AbstractCriteriaBuilder()
Method Detail

build

public abstract Criteria build(Criteria criteria,
                               Object filter)
Description copied from interface: CriteriaBuilder
Add Restrictions to Critera from filter

Specified by:
build in interface CriteriaBuilder
Parameters:
criteria - criteria to add restrictions
filter - Filter data
Returns:
criteria.

eq

protected void eq(Criteria criteria,
                  String property,
                  Object value)
Add a '=' Restriction on property

Parameters:
criteria - Criteria to add restriction
property - property path
value - restriction value

le

protected void le(Criteria criteria,
                  String property,
                  Object value)
Add a '<=' Restriction on property

Parameters:
criteria - Criteria to add restriction
property - property path
value - restriction value

ge

protected void ge(Criteria criteria,
                  String property,
                  Object value)
Add a '>=' Restriction on property

Parameters:
criteria - Criteria to add restriction
property - property path
value - restriction value

like

protected void like(Criteria criteria,
                    String property,
                    String value)
Add a ilike Restriction adding wrapping value on '%' and replacing '*' for '%'

Parameters:
criteria - Criteria to add restriction
property - property path
value - text for the ilike restriction


Copyright © 2012 JDAL. All Rights Reserved.