|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.enterprise.search.server.WhereClauseHandler
Translates the where clause from the client into AttributeContainerSets
Supported API: false
Extendable: false
Field Summary | |
private static String |
ATTR_NAME_REG_EX
one or more characters until the next !, =, < or > |
private static String |
CLASSNAME
|
private static Pattern |
DOUBLE_PAREN_PATTERN
2 open parens followed by 0..1 search terms followed by 2 close parnes |
private static Pattern |
EMPTY_TERM_PATTERN
()|,()&,|(),&() |
static long |
EXTERNALIZATION_VERSION_UID
|
private static Pattern |
FAKE_CREATOR_REGEX
|
private static Pattern |
FAKE_NAME_REGEX
|
private static Pattern |
FAKE_NUMBER_REGEX
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
OPERATOR_REG_EX
!=,<=,>=,=,<,> |
private static Hashtable |
PROPERTY_DESCRIPTOR_CACHE
Cache of property descriptors. |
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private static DefaultFeedbackSpec |
SPEC
Feedback spec for PrepareEntityCommand. |
private static String |
TERM_REG_EX
represents a valid search term attributeName='value' |
private static String |
TERM_VALUE_REG_EX
', then everything up until next unescaped ' |
private static Pattern |
TOKEN_PATTERN
(,),&,|,valid operators,valid attribute names,valid values |
private static Pattern |
UNNECESSARY_ESCAPE_PATTERN
a non \ character, followed by an odd number of \s, followed by a invalid escape character (not \,% or _) |
private static Pattern |
VALID_WHERE_CLAUSE_PATTERN
0..* parens followed by 0..1 search terms followed by 0..* parens, then 0..* additional parened search terms preceeded with an & or | |
Constructor Summary | |
(package private) |
WhereClauseHandler()
|
Method Summary | |
private static String |
buildWhereClause(String cacheKey,
String typename)
Creates sub-where clause for attributes mapped in SearchableAttribtuesByType cache. |
private static AttributeContainerSet |
createAttributeContainerSetFromTerm(Stack whereStack,
String rightStr,
SearchInfo searchInfo)
Given a left='right' expression, return an AttributeContainerSet representing that search term. |
private static AttributeContainerSet |
createCompositeAttributeContainerSet(Stack whereStack,
SearchInfo searchInfo,
boolean isUnion,
boolean errorOnEmpty)
Creates a AttributeContainerSet out of all AttributeContainerSets in the stack, up until the next open paren is encountered. |
private static String |
escapeAndAliasSpecialCharacters(String whereClause,
TypeIdentifier attributeTypeContext)
Given a where clause, perform the following: 1) remove "fake" attribute name prefixes 2) replace all unescaped asterisks with percents 3) unescape escaped asterisks |
private static Class |
getClassForAttributeType(AttributeTypeIdentifier attrTypeId)
Given an AttributeTypeIdentifier return its property type. |
private static Object |
getDateFromValue(Object value,
AttributeTypeIdentifier ati)
Given a value and an attribute determine if the attribute is of type java.sql.Timestamp and if it is return a Date object to be used as value to query against. |
private static AttributeContainerSet |
getEqualsCriteria(AttributeTypeIdentifier[] atis,
Object value,
boolean negated)
Creates an AttributeContainerSet for each name=value and name!=value term. |
private static String |
getFormattedWhereClause(SearchInfo searchInfo)
If the current search is a keyword search handles keyword" attribute. |
private static AttributeContainerSet |
getGreaterThanLessThanCriteria(AttributeTypeIdentifier[] atis,
Object right,
boolean greaterThan,
boolean inclusive)
Returns an AttributeContainerSet for each name |
private static AttributeContainerSet |
getGreaterThanLessThanCriteria(AttributeTypeIdentifier ati,
Object value,
boolean greaterThan,
boolean inclusive)
Creates an AttributeContainerSet for the given attribute value pair. |
private static Object |
getIBAValue(Object right,
Locale locale,
AttributeTypeIdentifier ati)
Given an IBA attribute and it's value return the correct wrapper object to find the value in the database. |
private static Timestamp |
getTimestamp(String value)
Given a String value for a date of the form "yyyy-MM-dd" e.g., "2003-11-13" get a Timestamp object. |
(package private) static AttributeContainerSet |
getWhereClauseCriteria(SearchInfo searchInfo)
Generates where clause specific criteria for a search. |
private static AttributeContainerSet |
getWildcardCriteria(AttributeTypeIdentifier[] atis,
int wildcardMode,
String pattern,
boolean negated)
Returns an AttributeContainerSet containing a criteria for each AttributeTypeIdentifier. |
private static boolean |
isApplyUpperFunction(AttributeTypeIdentifier ati)
Determines if an uppercase property is defined for the input AttributeTypeIdentifier. |
private static AttributeContainerSet |
processWhereClause(SearchInfo searchInfo,
String formattedWhereClause)
Tokenizes the where clause. |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(WhereClauseHandler thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
private static String |
replaceFakeNameAndNumber(String whereClause,
TypeIdentifier attributeTypeContext)
|
private static String |
simplifyWhereClause(String whereClause)
Simplifies where clause for tokenizing. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final String ATTR_NAME_REG_EX
private static final String OPERATOR_REG_EX
private static final String TERM_VALUE_REG_EX
private static final String TERM_REG_EX
private static final Pattern VALID_WHERE_CLAUSE_PATTERN
private static final Pattern DOUBLE_PAREN_PATTERN
private static final Pattern EMPTY_TERM_PATTERN
private static final Pattern TOKEN_PATTERN
private static final Pattern UNNECESSARY_ESCAPE_PATTERN
private static final Hashtable PROPERTY_DESCRIPTOR_CACHE
private static final DefaultFeedbackSpec SPEC
private static final Pattern FAKE_NAME_REGEX
private static final Pattern FAKE_NUMBER_REGEX
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static final Pattern FAKE_CREATOR_REGEX
Constructor Detail |
WhereClauseHandler()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(WhereClauseHandler thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
static AttributeContainerSet getWhereClauseCriteria(SearchInfo searchInfo) throws WTException
searchInfo
-
WTException
private static String getFormattedWhereClause(SearchInfo searchInfo) throws WTException
searchInfo
-
WTException
private static String escapeAndAliasSpecialCharacters(String whereClause, TypeIdentifier attributeTypeContext)
whereClause
- attributeTypeContext
- Pass the TypeIdentifier in so we can get the alias information from the properties cache
private static String simplifyWhereClause(String whereClause)
whereClause
-
private static AttributeContainerSet processWhereClause(SearchInfo searchInfo, String formattedWhereClause) throws WTException
searchInfo
- formattedWhereClause
-
WTException
private static AttributeContainerSet createCompositeAttributeContainerSet(Stack whereStack, SearchInfo searchInfo, boolean isUnion, boolean errorOnEmpty) throws WTException
whereStack
- searchInfo
- isUnion
- errorOnEmpty
-
WTException
private static AttributeContainerSet createAttributeContainerSetFromTerm(Stack whereStack, String rightStr, SearchInfo searchInfo) throws WTException
whereStack
- rightStr
- searchInfo
-
WTException
private static Class getClassForAttributeType(AttributeTypeIdentifier attrTypeId) throws WTException
attrTypeId
-
WTException
private static Object getIBAValue(Object right, Locale locale, AttributeTypeIdentifier ati) throws WTException
right
- locale
- ati
-
WTException
private static Timestamp getTimestamp(String value) throws WTException
value
-
WTException
private static AttributeContainerSet getWildcardCriteria(AttributeTypeIdentifier[] atis, int wildcardMode, String pattern, boolean negated) throws WTException
atis
- wildcardMode
- pattern
- negated
-
WTException
private static AttributeContainerSet getEqualsCriteria(AttributeTypeIdentifier[] atis, Object value, boolean negated) throws WTException
atis
- value
- negated
-
WTException
private static Object getDateFromValue(Object value, AttributeTypeIdentifier ati) throws WTException
value
- ati
-
WTException
private static AttributeContainerSet getGreaterThanLessThanCriteria(AttributeTypeIdentifier[] atis, Object right, boolean greaterThan, boolean inclusive) throws WTException
atis
- right
- greaterThan
- inclusive
-
WTException
private static AttributeContainerSet getGreaterThanLessThanCriteria(AttributeTypeIdentifier ati, Object value, boolean greaterThan, boolean inclusive) throws WTException
ati
- value
- greaterThan
- inclusive
-
WTException
private static boolean isApplyUpperFunction(AttributeTypeIdentifier ati) throws WTException
ati
-
WTException
private static String replaceFakeNameAndNumber(String whereClause, TypeIdentifier attributeTypeContext)
whereClause
- attributeTypeContext
-
private static String buildWhereClause(String cacheKey, String typename)
cacheKey
- typename
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |