org.squashtest.csp.tm.domain.report.query.hibernate
Class ReportCriterion

java.lang.Object
  extended by org.squashtest.csp.tm.domain.report.query.hibernate.ReportCriterion
Direct Known Subclasses:
AboveDateCriterion, BelowDateCriterion, IsInSet, IsRunningCampaignCriterion

public abstract class ReportCriterion
extends Object

This class explicitly designs a criterion for a HibernateReportQuery. The primary goal of this class is to hold all the informations and metainformations describing a particular Criterion for the parent Query. Implementing classes must also implement a method that return a Hibernate Criterion based on those informations. Implementing the ReportCriterion : ================================== - makeCriterion() will generate the corresponding Hibernate Criterion, based on the informations you fed the instance with. You might not need all of its properties (see the setters below) and those properties exist for convenience in case you need them.

Author:
bsiri

Constructor Summary
ReportCriterion()
           
ReportCriterion(String criterionName, String attributePath)
          Rich constructor for a ReportCriterion.
 
Method Summary
 String getAttributePath()
           
 String getCriterionName()
           
protected  String getEntityAlias()
           
protected  Class<?> getEntityClass()
           
protected  QueryOperator getOperator()
           
protected  Class<?> getParamClass()
           
 Object[] getParameters()
           
abstract  org.hibernate.criterion.Criterion makeCriterion()
          This method will convert, using some of its properties, a Hibernate Criterion corresponding to that ReportCriterion.
 void setAttributePath(String attributePath)
           
 void setCriterionName(String criterionName)
           
protected  void setEntityAlias(String entityAlias)
          Sets an alternate alias for the target entity.
protected  void setEntityClass(Class<?> entityClass)
           
protected  void setOperator(QueryOperator operator)
          Sets a semantic hint about what will the criterion do.
protected  void setParamClass(Class<?> paramClass)
          Specify the class of the parameters.
 void setParameter(Object... params)
           
protected  void setParameters(Object[] parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportCriterion

public ReportCriterion()

ReportCriterion

public ReportCriterion(String criterionName,
                       String attributePath)
Rich constructor for a ReportCriterion.

Parameters:
criterionName - the name for that Criterion.
attributePath - the path to the property of the target Hibernate entity.
Method Detail

getCriterionName

public String getCriterionName()

setCriterionName

public void setCriterionName(String criterionName)

setAttributePath

public void setAttributePath(String attributePath)

setParameter

public void setParameter(Object... params)

getAttributePath

public String getAttributePath()

getParameters

public Object[] getParameters()
Returns:
the raw parameters, non typed.

getEntityClass

protected Class<?> getEntityClass()
Returns:
the class of the target entity.

setEntityClass

protected void setEntityClass(Class<?> entityClass)

getEntityAlias

protected String getEntityAlias()

setEntityAlias

protected void setEntityAlias(String entityAlias)
Sets an alternate alias for the target entity.

Parameters:
entityAlias -

getParamClass

protected Class<?> getParamClass()

setParamClass

protected void setParamClass(Class<?> paramClass)
Specify the class of the parameters.

Parameters:
paramClass - the java class of the parameters.

getOperator

protected QueryOperator getOperator()

setOperator

protected void setOperator(QueryOperator operator)
Sets a semantic hint about what will the criterion do. Implementations might use that hint or not.

Parameters:
operator -

setParameters

protected void setParameters(Object[] parameters)

makeCriterion

public abstract org.hibernate.criterion.Criterion makeCriterion()
This method will convert, using some of its properties, a Hibernate Criterion corresponding to that ReportCriterion.

Returns:
the converted Criterion.


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.