Class CriteriaSearchParameter


  • public class CriteriaSearchParameter
    extends Object
    A CriteriaSearchParameter represents a parameter for a CriteriaSearch.

    The parameterValue is the actual value to be searched for.

    The parameterPattern describes the actual parameter which shall be considered for the search. It contains the dot-seperated path and the name of the parameter starting at the rootEntity of the actual CriteriaSearch. The pattern of a the street of an address of a person would look like address.street (assuming the entity structure to be aPerson.getAddress().getStreet()).

    Usually, if a parameter is null (or if the parameter is of type String and empty), it is not considered for a search. If searchIfIsNull is true it is explicitly searched for the parameter to be null (or empty if the parameter is of type String).

    The comparatorID defines the comparator for the parameter. For parameters of type String the default comparator is the LIKE_COMPARATOR. The EQUAL_COMPARATOR is default for other parameters.
    • Constructor Detail

      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern)
        Constructor for CriteriaSearchParameter. Sets searchIfIsNull to false and uses the EQUAL_COMPARATOR.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String parameterValue,
                                       String parameterPattern)
        Constructor for CriteriaSearchParameter for a String parameter. Sets searchIfIsNull to false and uses the LIKE_COMPARATOR.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String[] parameterValue,
                                       String parameterPattern)
        Constructor for CriteriaSearchParameter for a String[] parameter. Sets searchIfIsNull to false and uses the LIKE_COMPARATOR.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       int comparatorID)
        Constructor for CriteriaSearchParameter. Sets searchIfIsNull to false.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String[] parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull,
                                       int comparatorID)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
        comparatorID - Indicates what comparator is to be used (e.g. like, =, <, ...).
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String[] parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String parameterValue,
                                       String parameterPattern,
                                       boolean searchIfnull,
                                       int comparatorID,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        searchIfIsNull - Indicates whether the query should contain an IS null if the parameter is null.
        comparatorID - Indicates what comparator is to be used (e.g. like, =, <, ...).
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       int comparatorID,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        comparatorID - Indicates what comparator is to be used (e.g. like, =, <, ...).
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(Object parameterValue,
                                       String parameterPattern,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String parameterValue,
                                       String parameterPattern,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        matchMode - The hibernate matchmode to be used in string comparisons.
      • CriteriaSearchParameter

        public CriteriaSearchParameter​(String[] parameterValue,
                                       String parameterPattern,
                                       org.hibernate.criterion.MatchMode matchMode)
        Constructor for CriteriaSearchParameter.
        Parameters:
        parameterValue - The actual value of the parameter.
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
        matchMode - The hibernate matchmode to be used in string comparisons.
    • Method Detail

      • getComparatorID

        public int getComparatorID()
        Returns:
        The comparator to be used (e.g. like, =, <, ...).
      • setComparatorID

        public void setComparatorID​(int comparatorID)
        Sets the comparator to be used (e.g. like, =, <, ...).
        Parameters:
        comparatorID - The comprator ID.
      • getParameterPattern

        public String getParameterPattern()
        Returns:
        The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • setParameterPattern

        public void setParameterPattern​(String parameterPattern)
        Sets the pattern of this parameter.
        Parameters:
        parameterPattern - The pattern of this parameter (dot-seperated path e.g. person.address.street).
      • getParameterName

        public String getParameterName()
        Returns:
        The last part of the parameter pattern, i.e. the attribute name.
      • getParameterValue

        public Object getParameterValue()
        Returns:
        The value of this parameter.
      • setParameterValue

        public void setParameterValue​(Object parameterValue)
        Sets the value of this parameter.
        Parameters:
        parameterValue - The value of this parameter.
      • isSearchIfIsNull

        public boolean isSearchIfIsNull()
        Returns:
        Whether this parameter will be included in the search even if it is null.
      • setSearchIfIsNull

        public void setSearchIfIsNull​(boolean searchIfnull)
        Defines whether parameter will be included in the search even if it is null.
        Parameters:
        searchIfnull - true if the parameter should be included in the search even if it is null, false otherwise.
      • getMatchMode

        public org.hibernate.criterion.MatchMode getMatchMode()
        Returns:
        The hibernate matchmode of this parameter.
      • setMatchMode

        public void setMatchMode​(org.hibernate.criterion.MatchMode matchMode)
        Sets the hibernate matchmode of this parameter.
        Parameters:
        matchMode - The hibernate matchmode.
      • getOrderDirection

        public int getOrderDirection()
        Returns:
        The order (ascending or descending) for this parameter.
        See Also:
        ORDER_ASC, ORDER_DESC, ORDER_UNSET
      • setOrderDirection

        public void setOrderDirection​(int orderDirection)
        Sets the ordering for this parameter.
        Parameters:
        orderDirection - The ordering for this parameter.
      • getOrderRelevance

        public int getOrderRelevance()
        Returns:
        The relevance for this parameter.
        See Also:
        RELEVANCE_UNSET
      • setOrderRelevance

        public void setOrderRelevance​(int relevance)
        Sets the ordering relevance for this parameter.
        Parameters:
        order - The ordering relevance for this parameter.