edu.ucsb.nceas.metacat

## Class QueryTerm

- java.lang.Object
- - edu.ucsb.nceas.metacat.QueryTerm

-     public class QueryTerm
      extends java.lang.Object

  a utility class that represents a single term in a query

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CONTAINS`
    `static java.lang.String` | `EQUALS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryTerm(boolean casesensitive, java.lang.String searchmode, java.lang.String value)` Construct a new instance of a query term for a free text search (using the value only)
    `QueryTerm(boolean casesensitive, java.lang.String searchmode, java.lang.String value, java.lang.String pathexpr)` Construct a new instance of a query term for a structured search (matching the value only for those nodes in the pathexpr)

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getPathExpression()` get the path expression parameter
    `int` | `getPercentageSymbolCount()` get the percentage count for one query term
    `java.lang.String` | `getSearchMode()` get the searchmode parameter
    `java.lang.String` | `getValue()` get the Value parameter
    `boolean` | `hasSameSearchValue(QueryTerm term)` Compare two query terms to see if they have same search value.
    `boolean` | `isCaseSensitive()` determine if the QueryTerm is case sensitive
    `boolean` | `isInUnionGroup()` If this query group in Union group
    `boolean` | `isNotEqualTerm()`
    `static java.lang.String` | `predicate2SQL(java.lang.String predicate, java.util.List<java.lang.Object> predicateParameterValues)`
    `java.lang.String` | `printSearchExprSQL(java.util.List<java.lang.Object> parameterValues)`
    `java.lang.String` | `printSQL(boolean useXMLIndex, java.util.List<java.lang.Object> parameterValues)` create a SQL serialization of the query that this instance represents
    `void` | `setInUnionGroup(boolean inUnionGroup)` Set the query term in a union group
    `java.lang.String` | `toString()` Deprecated. This should not be used for performing the query because the parameter values are not bound in the raw SQL
    `static java.lang.String` | `useNestedStatements(java.lang.String pathexpr, java.util.List<java.lang.Object> parameterValues)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CONTAINS

          public static final java.lang.String CONTAINS

      See Also:
        Constant Field Values

    - #### EQUALS

          public static final java.lang.String EQUALS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### QueryTerm

          public QueryTerm(boolean casesensitive,
                           java.lang.String searchmode,
                           java.lang.String value)

      Construct a new instance of a query term for a free text search (using the value only)
      Parameters:
        `casesensitive` - flag indicating whether case is used to match
        `searchmode` - determines what kind of substring match is performed (one of starts-with|ends-with|contains|matches-exactly)
        `value` - the text value to match

    - #### QueryTerm

          public QueryTerm(boolean casesensitive,
                           java.lang.String searchmode,
                           java.lang.String value,
                           java.lang.String pathexpr)

      Construct a new instance of a query term for a structured search (matching the value only for those nodes in the pathexpr)
      Parameters:
        `casesensitive` - flag indicating whether case is used to match
        `searchmode` - determines what kind of substring match is performed (one of starts-with|ends-with|contains|matches-exactly)
        `value` - the text value to match
        `pathexpr` - the hierarchical path to the nodes to be searched

  - ### Method Detail

    - #### isCaseSensitive

          public boolean isCaseSensitive()

      determine if the QueryTerm is case sensitive

    - #### getSearchMode

          public java.lang.String getSearchMode()

      get the searchmode parameter

    - #### getValue

          public java.lang.String getValue()

      get the Value parameter

    - #### getPathExpression

          public java.lang.String getPathExpression()

      get the path expression parameter

    - #### getPercentageSymbolCount

          public int getPercentageSymbolCount()

      get the percentage count for one query term

    - #### setInUnionGroup

          public void setInUnionGroup(boolean inUnionGroup)

      Set the query term in a union group
      Parameters:
        `inUnionGroup` -

    - #### isInUnionGroup

          public boolean isInUnionGroup()

      If this query group in Union group
      Returns:

    - #### printSearchExprSQL

          public java.lang.String printSearchExprSQL(java.util.List<java.lang.Object> parameterValues)

    - #### isNotEqualTerm

          public boolean isNotEqualTerm()

    - #### printSQL

          public java.lang.String printSQL(boolean useXMLIndex,
                                           java.util.List<java.lang.Object> parameterValues)

      create a SQL serialization of the query that this instance represents

    - #### useNestedStatements

          public static java.lang.String useNestedStatements(java.lang.String pathexpr,
                                                             java.util.List<java.lang.Object> parameterValues)

    - #### predicate2SQL

          public static java.lang.String predicate2SQL(java.lang.String predicate,
                                                       java.util.List<java.lang.Object> predicateParameterValues)

    - #### toString

          public java.lang.String toString()

      Deprecated. This should not be used for performing the query because the parameter values are not bound in the raw SQL
      Show a string representation of the query
      Overrides:
        `toString` in class `java.lang.Object`

    - #### hasSameSearchValue

          public boolean hasSameSearchValue(QueryTerm term)

      Compare two query terms to see if they have same search value.
      Parameters:
        `term` -
      Returns:

Copyright © 2020 Regents of the University of California. All Rights Reserved.