Class Subquery

java.lang.Object
ubic.gemma.persistence.util.Subquery

public final class Subquery extends Object
Represents a subquery right-hand side of a Filter.

A subquery has rather limited structure:

select {rootAlias}.{propertyName} from {entityName} {rootAlias} join {aliases...} where {filter}

and is solely designed to nest a Filter in a subquery so that it can be applied to one-to-many relations.

The root alias is used whenever null is used as object alias in the aliases or filter. It can be declared by passing an Subquery.Alias with a null object alias and an empty property name.

Author:
poirgui
See Also:
  • Constructor Details

  • Method Details

    • withFilterPropertyName

      public Subquery withFilterPropertyName(String newPropertyName, @Nullable String originalProperty)
      Create a new subquery with a different property name for the filter.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getEntityName

      public String getEntityName()
      The entity name being queried.
    • getPropertyName

      public String getPropertyName()
      The property name being queried.
    • getAliases

      public List<Subquery.Alias> getAliases()
      List of aliases for resolving the object alias defined in filter.
    • getRootAlias

      public String getRootAlias()
      Root alias of this subquery.

      If none are defined in aliases, the default e is used.

    • getFilter

      public Filter getFilter()
      A filter being nested in the subquery.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object