Package de.hybris.platform.core
Class Operator
- java.lang.Object
-
- de.hybris.platform.core.FlexibleSearchTranslatable
-
- de.hybris.platform.core.Operator
-
- All Implemented Interfaces:
java.io.Serializable
public final class Operator extends FlexibleSearchTranslatable
Class represents an Operator; is used with all types ofGenericConditions
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Operator
AND
code: 17
symbol:AND
codestring:and
static Operator
CONTAINS
code: 6
symbol:LIKE
codestring:contains
static Operator
DEFAULT
The DEFAULT Operator is Operator.EQUALstatic Operator
ENDS_WITH
code: 5
symbol:LIKE
codestring:ends with
static Operator
EQUAL
code: 1
symbol:=
codestring:equal
static Operator
EXISTS
code: 15
symbol:EXISTS
codestring:exists
static Operator
GREATER
code: 7
symbol:>
codestring:>
static Operator
GREATER_OR_EQUAL
code: 9
symbol:>=
codestring:>=
static Operator
IN
code: 13
symbol:IN
codestring:in
static Operator
IS_NOT_NULL
code: 11
symbol:IS NOT NULL
codestring:is not null
static Operator
IS_NULL
code: 12
symbol:IS NULL
codestring:is null
static Operator
LESS
code: 8
symbol:<
codestring:<
static Operator
LESS_OR_EQUAL
code: 10
symbol:<=
codestring:<=
static Operator
LIKE
code: 3
symbol:LIKE
codestring:like
static Operator
NOT_EXISTS
code: 16
symbol:NOT_EXISTS
codestring:not exists
static Operator
NOT_IN
code: 14
symbol:NOT IN
codestring:not in
static Operator
NOT_LIKE
code: 19
symbol:NOT_LIKE
codestring:not like
static Operator
OR
code: 18
symbol:OR
codestring:or
static Operator
STARTS_WITH
code: 4
symbol:LIKE
codestring:starts with
static Operator
UNEQUAL
code: 2
symbol:<>
codestring:<>
-
Constructor Summary
Constructors Modifier Constructor Description protected
Operator(int code, java.lang.String sql_str, java.lang.String code_str)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsCollection()
boolean
equals(java.lang.Object arg0)
int
getCode()
static Operator
getOperatorByCode(int code)
static Operator
getOperatorByStringCode(java.lang.String str_code)
java.lang.String
getSQLString()
java.lang.String
getStringCode()
int
hashCode()
boolean
isTranslatableToPolyglotDialect()
boolean
isUnary()
void
toFlexibleSearch(java.lang.StringBuilder queryBuffer, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)
toFlexibleSearchjava.lang.String
toString()
-
Methods inherited from class de.hybris.platform.core.FlexibleSearchTranslatable
getAliasFromTypeMap, toPolyglotSearch
-
-
-
-
Field Detail
-
EQUAL
public static final Operator EQUAL
code: 1
symbol:=
codestring:equal
-
UNEQUAL
public static final Operator UNEQUAL
code: 2
symbol:<>
codestring:<>
-
LIKE
public static final Operator LIKE
code: 3
symbol:LIKE
codestring:like
-
STARTS_WITH
public static final Operator STARTS_WITH
code: 4
symbol:LIKE
codestring:starts with
-
ENDS_WITH
public static final Operator ENDS_WITH
code: 5
symbol:LIKE
codestring:ends with
-
CONTAINS
public static final Operator CONTAINS
code: 6
symbol:LIKE
codestring:contains
-
GREATER
public static final Operator GREATER
code: 7
symbol:>
codestring:>
-
LESS
public static final Operator LESS
code: 8
symbol:<
codestring:<
-
GREATER_OR_EQUAL
public static final Operator GREATER_OR_EQUAL
code: 9
symbol:>=
codestring:>=
-
LESS_OR_EQUAL
public static final Operator LESS_OR_EQUAL
code: 10
symbol:<=
codestring:<=
-
IS_NOT_NULL
public static final Operator IS_NOT_NULL
code: 11
symbol:IS NOT NULL
codestring:is not null
-
IS_NULL
public static final Operator IS_NULL
code: 12
symbol:IS NULL
codestring:is null
-
IN
public static final Operator IN
code: 13
symbol:IN
codestring:in
-
NOT_IN
public static final Operator NOT_IN
code: 14
symbol:NOT IN
codestring:not in
-
EXISTS
public static final Operator EXISTS
code: 15
symbol:EXISTS
codestring:exists
-
NOT_EXISTS
public static final Operator NOT_EXISTS
code: 16
symbol:NOT_EXISTS
codestring:not exists
-
AND
public static final Operator AND
code: 17
symbol:AND
codestring:and
-
OR
public static final Operator OR
code: 18
symbol:OR
codestring:or
-
NOT_LIKE
public static final Operator NOT_LIKE
code: 19
symbol:NOT_LIKE
codestring:not like
-
DEFAULT
public static final Operator DEFAULT
The DEFAULT Operator is Operator.EQUAL
-
-
Constructor Detail
-
Operator
protected Operator(int code, java.lang.String sql_str, java.lang.String code_str)
Constructor. Creates a new Operator with the code, the sql string (like 'IS NULL')- Parameters:
code
- code of the Operator, int value between 1 and 18sql_str
- the sql equivalent of this operator, like 'NOT IN' or 'AND'code_str
- the code string
-
-
Method Detail
-
getCode
public int getCode()
- Returns:
- the code.
-
getStringCode
public java.lang.String getStringCode()
- Returns:
- the string code, like '=' or 'not exists'
-
getSQLString
public java.lang.String getSQLString()
- Returns:
- the SQL query like 'NOT' or 'NOT_EXISTS'
-
toFlexibleSearch
public void toFlexibleSearch(java.lang.StringBuilder queryBuffer, java.util.Map<java.lang.String,java.lang.String> typeIndexMap, java.util.Map<java.lang.String,java.lang.Object> valueMap)
toFlexibleSearch- Specified by:
toFlexibleSearch
in classFlexibleSearchTranslatable
- Parameters:
typeIndexMap
- not used here!valueMap
- not used here!queryBuffer
- The Content ofgetSQLString()
is appended with a leading and ending " " to the QueryBuffer- See Also:
FlexibleSearchTranslatable.toFlexibleSearch(java.lang.StringBuilder, Map, Map)
-
getOperatorByStringCode
public static Operator getOperatorByStringCode(java.lang.String str_code)
- Parameters:
str_code
- the string code- Returns:
- a new Instance of the Operator which match the given string code. Please have a look at the constants of this class.
-
getOperatorByCode
public static Operator getOperatorByCode(int code)
- Parameters:
code
- the code of the Operator (at the moment: 1 - 18). Please have a look at the constants of this class.- Returns:
- new Instance of the Operator which match the given code (int value from 1 to 18)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equals
in classjava.lang.Object
- Returns:
- true if the Operators are equal (compared by Operator code)
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
allowsCollection
public boolean allowsCollection()
-
isUnary
public boolean isUnary()
-
isTranslatableToPolyglotDialect
public boolean isTranslatableToPolyglotDialect()
-
-