wt.query
Class AttributeSearchSpecification

java.lang.Object
  extended bywt.query.AttributeSearchSpecification
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AttributeRangeSearch, BooleanSearch, EnumeratedTypeSearch, FloatSearch, IntegerSearch, LongSearch, ObjectReferenceSearch, StringSearch, TimestampSearch, VersionIdentifierSearch

public abstract class AttributeSearchSpecification
extends Object
implements Serializable

Specifies the basic contract for a database search against an attribute of a Windchill Persistable object. The template for attribute validation and SearchCondition construction is specified.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  String attributeName
           
private static String CLASSNAME
           
(package private) static char DB_SINGLE_WILDCARD
           
(package private) static char DB_WILDCARD
           
private  boolean falseSearch
           
private static Hashtable OPERATOR_MAP
           
private static String RESOURCE
           
private  String searchExpression
           
private static char SINGLE_EMPTY
           
private static char SITE_SINGLE_WILDCARD
           
private static String SITE_WILDCARD
           
private  Object value
           
private static char WILDCARD_ESCAPE
           
 
Constructor Summary
AttributeSearchSpecification(String attribute, String expression)
          Construct a search object for the specified attribute.
 
Method Summary
 void appendToClassSearchSpec(DefaultClassSearchSpec a_classSearchSpec, Class a_class)
           
static boolean areThereDBWildCards(String value)
           
static boolean areThereWildCards(String value)
           
static String convertWildcardValue(String attribute_value)
           
private  String escapeChar(String value, char db_wildcard, char escape)
           
private  String escapeEscape(String value, String wildcards, char escape)
           
private static String fixWildCards(String value, char site_wildcard, char db_wildcard, char escape)
           
 String getAttributeName()
          Gets the value of the attribute: attributeName; The name of the attribute.
 String getQueryName(Class classname)
          Return the QUERY_NAME from the introspection on the attribute and class for this AttributeSearchSpecification.
 SearchCondition getSearchCondition(Class classname)
          Return a SearchCondition for this search object.
 String getSearchExpression()
          Gets the value of the attribute: searchExpression; The type of search: equal, greater than, less than, and between.
static SearchExpression getSearchExpression(SearchCondition a_searchCondition, boolean a_falseSearch)
           
 String getSearchType()
          Returns the search expression used by the Persistence Manager for search the database.
 CaseKind getStringCase(Class classname)
          Return the STRING_CASE from the introspection on the attribute and class for this AttributeSearchSpecification.
 Object getValue()
          Gets the value of the attribute: value; The value for the attribute to be used in the search criteria.
 boolean isFalseSearch()
          Gets the value of the attribute: falseSearch; True if the search against this attribute should be a negative search != versus =, >= versus <, etc.
 String processWildCards(String in_value)
           
 void setFalseSearch(boolean a_FalseSearch)
          Sets the value of the attribute: falseSearch; True if the search against this attribute should be a negative search != versus =, >= versus <, etc.
protected  void setValue(Object a_Value)
          Sets the value of the attribute: value; The value for the attribute to be used in the search criteria.
 void setValue(String attribute_value)
          Set the desired value for the attribute.
 String toString()
          Return a string dump of the interesting information in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

falseSearch

private boolean falseSearch

value

private Object value

attributeName

private String attributeName

searchExpression

private String searchExpression

OPERATOR_MAP

private static final Hashtable OPERATOR_MAP

SITE_WILDCARD

private static final String SITE_WILDCARD

SITE_SINGLE_WILDCARD

private static final char SITE_SINGLE_WILDCARD

DB_WILDCARD

static final char DB_WILDCARD
See Also:
Constant Field Values

DB_SINGLE_WILDCARD

static final char DB_SINGLE_WILDCARD
See Also:
Constant Field Values

WILDCARD_ESCAPE

private static final char WILDCARD_ESCAPE

SINGLE_EMPTY

private static final char SINGLE_EMPTY
See Also:
Constant Field Values
Constructor Detail

AttributeSearchSpecification

public AttributeSearchSpecification(String attribute,
                                    String expression)
Construct a search object for the specified attribute.

Supported API: false

Parameters:
attribute - Attribute name.
expression - Search expression such as equals.
Method Detail

isFalseSearch

public boolean isFalseSearch()
Gets the value of the attribute: falseSearch; True if the search against this attribute should be a negative search != versus =, >= versus <, etc.

Supported API: false

Returns:
boolean

setFalseSearch

public void setFalseSearch(boolean a_FalseSearch)
                    throws WTPropertyVetoException
Sets the value of the attribute: falseSearch; True if the search against this attribute should be a negative search != versus =, >= versus <, etc.

Supported API: false

Parameters:
a_FalseSearch -
Throws:
WTPropertyVetoException

getValue

public Object getValue()
Gets the value of the attribute: value; The value for the attribute to be used in the search criteria.

Supported API: false

Returns:
Object

setValue

protected void setValue(Object a_Value)
                 throws WTPropertyVetoException
Sets the value of the attribute: value; The value for the attribute to be used in the search criteria.

Supported API: false

Parameters:
a_Value -
Throws:
WTPropertyVetoException

getAttributeName

public String getAttributeName()
Gets the value of the attribute: attributeName; The name of the attribute.

Supported API: false

Returns:
String

getSearchExpression

public String getSearchExpression()
Gets the value of the attribute: searchExpression; The type of search: equal, greater than, less than, and between. The not clause is handled by falseSearch.

Supported API: false

Returns:
String

setValue

public void setValue(String attribute_value)
              throws WTPropertyVetoException
Set the desired value for the attribute. The value is validated based on the rules for attribute type.

Supported API: false

Parameters:
attribute_value - Value to search for.
Throws:
WTPropertyVetoException

getSearchType

public String getSearchType()
Returns the search expression used by the Persistence Manager for search the database. Resolves searchExpression and falseSearch. Does not process for between.

Supported API: false

Returns:
String

getSearchCondition

public SearchCondition getSearchCondition(Class classname)
                                   throws WTException,
                                          QueryException
Return a SearchCondition for this search object. If a pre Search is required, this will be performed automatically. Intended to be a server side only api.

Supported API: false

Parameters:
classname - Class to search against.
Returns:
SearchCondition
Throws:
WTException
QueryException

toString

public String toString()
Return a string dump of the interesting information in this object.

Supported API: false

Returns:
String

getQueryName

public String getQueryName(Class classname)
                    throws WTIntrospectionException
Return the QUERY_NAME from the introspection on the attribute and class for this AttributeSearchSpecification.

Supported API: false

Parameters:
classname - Class to search against.
Returns:
String
Throws:
WTIntrospectionException

getStringCase

public CaseKind getStringCase(Class classname)
                       throws WTIntrospectionException
Return the STRING_CASE from the introspection on the attribute and class for this AttributeSearchSpecification.

Supported API: false

Parameters:
classname - Class to search against.
Returns:
CaseKind
Throws:
WTIntrospectionException

appendToClassSearchSpec

public void appendToClassSearchSpec(DefaultClassSearchSpec a_classSearchSpec,
                                    Class a_class)
                             throws WTException,
                                    WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

getSearchExpression

public static SearchExpression getSearchExpression(SearchCondition a_searchCondition,
                                                   boolean a_falseSearch)
                                            throws WTException,
                                                   WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

convertWildcardValue

public static String convertWildcardValue(String attribute_value)

processWildCards

public String processWildCards(String in_value)

escapeChar

private String escapeChar(String value,
                          char db_wildcard,
                          char escape)

escapeEscape

private String escapeEscape(String value,
                            String wildcards,
                            char escape)

fixWildCards

private static String fixWildCards(String value,
                                   char site_wildcard,
                                   char db_wildcard,
                                   char escape)

areThereWildCards

public static boolean areThereWildCards(String value)

areThereDBWildCards

public static boolean areThereDBWildCards(String value)