org.rhq.enterprise.server.search.translation.jpql
Enum SearchFragment.Type

java.lang.Object
  extended by java.lang.Enum<SearchFragment.Type>
      extended by org.rhq.enterprise.server.search.translation.jpql.SearchFragment.Type
All Implemented Interfaces:
Serializable, Comparable<SearchFragment.Type>
Enclosing class:
SearchFragment

public static enum SearchFragment.Type
extends Enum<SearchFragment.Type>

This indicates the representative form of the JPQL fragment.


Enum Constant Summary
PRIMARY_KEY_SUBQUERY
          More complicated filters can sometimes not restrict data by using path expressions because they need to navigate across OneToMany or ManyToMany mappings.
WHERE_CLAUSE
          A full where-clause fragment that can be included in a larger JPQL statement.
 
Method Summary
static SearchFragment.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SearchFragment.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WHERE_CLAUSE

public static final SearchFragment.Type WHERE_CLAUSE
A full where-clause fragment that can be included in a larger JPQL statement. This should be used in cases where the target can be found using (arbitrarily long) path expressions (by traversing over OneToOne or ManyToOne mappings, e.g. "alertDefinition.resource.resourceType.category = 'PLATFORM'", which might be useful to support filtering resources that have any alerts on platforms. Granted, the path expression is rarely ever that long, but it shows what's possible for this type's corresponding JPQL fragment.


PRIMARY_KEY_SUBQUERY

public static final SearchFragment.Type PRIMARY_KEY_SUBQUERY
More complicated filters can sometimes not restrict data by using path expressions because they need to navigate across OneToMany or ManyToMany mappings. In this case, since the fragment is intended to be used in a larger JPQL statement, a sub-query must be employed which will allow the use of joins (to navigate those more complex entity mappings). These sub-queries must always return a list of primary keys for the type of entity represented by the SearchSubsystem for the corresponding SearchTranslator in question.

Method Detail

values

public static SearchFragment.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SearchFragment.Type c : SearchFragment.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SearchFragment.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.