|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.portal.lql.LQLBuilder
public class LQLBuilder
Nested Class Summary | |
---|---|
static class |
LQLBuilder.AdditiveOp
Enum detailing mathematical operations that can be used in LQL queries. |
static class |
LQLBuilder.CompareOp
Enum detailing operations usable in the LQL ComparisonExpression. |
static class |
LQLBuilder.Function
Enum detailing functions usable in the LQL FunctionCallExpression. |
static class |
LQLBuilder.LQLMDEXType
Represents types that come from MDEX records generated by LQL. |
static class |
LQLBuilder.MultiplicativeOp
|
Constructor Summary | |
---|---|
LQLBuilder()
|
Method Summary | |
---|---|
static com.endeca.mdex.lql_parser.types.AdditiveExpression |
makeAdditiveExpression(com.endeca.mdex.lql_parser.types.ExpressionBase left,
com.endeca.mdex.lql_parser.types.ExpressionBase right,
LQLBuilder.AdditiveOp op)
Creates an AdditiveExpression with the give left expression and right expression, using the given math operation. |
static com.endeca.mdex.lql_parser.types.AndExpression |
makeAnd(com.endeca.mdex.lql_parser.types.ExpressionBase left,
com.endeca.mdex.lql_parser.types.ExpressionBase right)
Creates an AndExpression representing a logical AND of the two sub expressions. |
static com.endeca.mdex.lql_parser.types.AttributeRefExpression |
makeAttributeRef(java.lang.String attributeKey)
Creates an AttributeRefExpression that is used when an attribute key is needed. |
static com.endeca.mdex.lql_parser.types.BooleanLiteral |
makeBooleanLiteral(boolean value)
|
static com.endeca.mdex.lql_parser.types.BooleanLiteral |
makeBooleanLiteral(java.lang.String value)
|
static com.endeca.mdex.lql_parser.types.ComparisonExpression |
makeComparisonExpression(com.endeca.mdex.lql_parser.types.ExpressionBase left,
com.endeca.mdex.lql_parser.types.ExpressionBase right,
LQLBuilder.CompareOp op)
Creates a ComparisonExpression comparing a left expression with a right expression, using the given compare operation. |
static com.endeca.mdex.lql_parser.types.DoubleLiteral |
makeDoubleLiteral(java.lang.Double value)
Creates a DoubleLiteral for the given value. |
static com.endeca.mdex.lql_parser.types.DoubleLiteral |
makeDoubleLiteral(java.lang.String d)
|
static com.endeca.mdex.lql_parser.types.ComparisonExpression |
makeEquals(java.lang.String key,
com.endeca.mdex.lql_parser.types.ExpressionBase rhs)
Convenience function to create a ComparrisonExpression representing "key = |
static com.endeca.mdex.lql_parser.types.From |
makeFrom(com.endeca.mdex.lql_parser.types.SourceBase source)
Creates a LQL From object with the given source. |
static com.endeca.mdex.lql_parser.types.From |
makeFrom(java.lang.String statementName)
Convenience function to create an LQL From denoting a named statement. |
static com.endeca.mdex.lql_parser.types.FunctionCallExpression |
makeFunctionCallExpression(LQLBuilder.Function f,
com.endeca.mdex.lql_parser.types.ExpressionBase... args)
Helper method for making FunctionCallExpressions. |
static com.endeca.mdex.lql_parser.types.FunctionCallExpression |
makeFunctionCallExpression(LQLBuilder.Function f,
com.endeca.mdex.lql_parser.types.Where w,
com.endeca.mdex.lql_parser.types.ExpressionBase... args)
Helper method for making FunctionCallExpressions. |
static com.endeca.mdex.lql_parser.types.GroupBy |
makeGroupBy(java.lang.String key)
Creates a GroupBy for the given attribute key. |
static com.endeca.mdex.lql_parser.types.GroupBy |
makeGroupBy(java.lang.String key,
java.math.BigInteger depth)
Creates a GroupBy for the given attribute key and a depth. |
static com.endeca.mdex.lql_parser.types.GroupByList |
makeGroupByList(java.lang.String... groupKeys)
Creates a GroupByList containing one GroupBy for each key in the list of groupKeys |
static com.endeca.mdex.lql_parser.types.Having |
makeHaving(com.endeca.mdex.lql_parser.types.ExpressionBase filter)
Creates a Having object with the given filter. |
static com.endeca.mdex.lql_parser.types.InExpression |
makeInExpression(java.lang.String targetStatementKey,
java.util.List<? extends com.endeca.mdex.lql_parser.types.ExpressionBase> lookupValues)
Creates a InExpression with the given target statement and lookup values. |
static com.endeca.mdex.lql_parser.types.InnerJoin |
makeInnerJoin(com.endeca.mdex.lql_parser.types.SourceBase left,
com.endeca.mdex.lql_parser.types.SourceBase right,
com.endeca.mdex.lql_parser.types.ExpressionBase condition)
Creates an InnerJoin that can be used as part of a From. |
static com.endeca.mdex.lql_parser.types.IntegerLiteral |
makeIntegerLiteral(java.math.BigInteger value)
|
static com.endeca.mdex.lql_parser.types.LookupExpression |
makeLookupExpression(java.lang.String targetStatementKey,
java.lang.String targetAttributeKey,
java.util.List<? extends com.endeca.mdex.lql_parser.types.ExpressionBase> lookupValues)
Creates a LookupExpression with the given target statement, target attribute key, and lookup values. |
static com.endeca.mdex.lql_parser.types.MultiplicativeExpression |
makeMultiplicativeExpression(com.endeca.mdex.lql_parser.types.ExpressionBase leftOperand,
com.endeca.mdex.lql_parser.types.ExpressionBase rightOperand,
LQLBuilder.MultiplicativeOp op)
Creates a multiplicative expression with the given left hand expression, right hand expression, and the mathematical operation to be performed. |
static com.endeca.mdex.lql_parser.types.OrExpression |
makeOr(com.endeca.mdex.lql_parser.types.ExpressionBase left,
com.endeca.mdex.lql_parser.types.ExpressionBase right)
Creates an ORExpression representing a logical OR of the two sub expressions. |
static com.endeca.mdex.lql_parser.types.OrderBy |
makeOrderBy(java.lang.String attributeKey,
boolean isAscending)
Creates an OrderBy on the given attribute key with the given direction. |
static com.endeca.mdex.lql_parser.types.OrderByList |
makeOrderByList(com.endeca.mdex.lql_parser.types.OrderBy... orderBys)
Creates an OrderByList given a set of OrderBy objects |
static com.endeca.mdex.lql_parser.types.OrderByList |
makeOrderByList(java.lang.String attributeKey,
boolean isAscending)
Creates an OrderByList containing one OrderBy for the given attribute key and direction. |
static com.endeca.mdex.lql_parser.types.Paging |
makePaging(java.math.BigInteger offset,
java.math.BigInteger count)
Creates a Paging object specifying which records should be returned by an LQL query. |
static com.endeca.mdex.lql_parser.types.Select |
makeSelect(java.lang.String attributeKey)
Convenience function to create a new LQL Select object that selects a particular attribute key. |
static com.endeca.mdex.lql_parser.types.Select |
makeSelect(java.lang.String name,
com.endeca.mdex.lql_parser.types.ExpressionBase expression)
Creates a new LQL Select object with the given name and expression. |
static com.endeca.mdex.lql_parser.types.Statement |
makeStatement(java.lang.String statementKey,
boolean isReturnTable)
Convenience function to create a new Statement object |
static com.endeca.mdex.lql_parser.types.StatementSource |
makeStatementSource(java.lang.String statementKey)
Creates a StatementSouce to be used in a From or an InnerJoin. |
static com.endeca.mdex.lql_parser.types.StringLiteral |
makeStringLiteral(java.lang.String value)
|
static com.endeca.mdex.lql_parser.types.Where |
makeWhere(com.endeca.mdex.lql_parser.types.ExpressionBase filter)
Creates a Where that can be set on an LQL statement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LQLBuilder()
Method Detail |
---|
public static com.endeca.mdex.lql_parser.types.Statement makeStatement(java.lang.String statementKey, boolean isReturnTable)
statementKey
- isReturnTable
-
public static com.endeca.mdex.lql_parser.types.Select makeSelect(java.lang.String attributeKey)
attributeKey
- Attribute key to select
public static com.endeca.mdex.lql_parser.types.Select makeSelect(java.lang.String name, com.endeca.mdex.lql_parser.types.ExpressionBase expression)
name
- Name for the selection. This would be used as an attribute key or
if referenced in another statement.expression
- An expression to be selected. This can be any expression that
returns a value (e.g. a FunctionCallExpression representing "AVG(P_Price)")
public static com.endeca.mdex.lql_parser.types.StatementSource makeStatementSource(java.lang.String statementKey)
statementKey
- Name of an LQL statement
public static com.endeca.mdex.lql_parser.types.AttributeRefExpression makeAttributeRef(java.lang.String attributeKey)
attributeKey
- Attribute key to reference.
public static com.endeca.mdex.lql_parser.types.LookupExpression makeLookupExpression(java.lang.String targetStatementKey, java.lang.String targetAttributeKey, java.util.List<? extends com.endeca.mdex.lql_parser.types.ExpressionBase> lookupValues)
targetStatementKey
- targetAttributeKey
- lookupValues
-
public static com.endeca.mdex.lql_parser.types.InExpression makeInExpression(java.lang.String targetStatementKey, java.util.List<? extends com.endeca.mdex.lql_parser.types.ExpressionBase> lookupValues)
targetStatementKey
- lookupValues
-
public static com.endeca.mdex.lql_parser.types.MultiplicativeExpression makeMultiplicativeExpression(com.endeca.mdex.lql_parser.types.ExpressionBase leftOperand, com.endeca.mdex.lql_parser.types.ExpressionBase rightOperand, LQLBuilder.MultiplicativeOp op)
leftOperand
- rightOperand
- op
-
public static com.endeca.mdex.lql_parser.types.From makeFrom(java.lang.String statementName)
statementName
- Name of the statement to use as a source.
public static com.endeca.mdex.lql_parser.types.From makeFrom(com.endeca.mdex.lql_parser.types.SourceBase source)
source
- Source to use in the From clause. Can be a StatementSource or an
InnerJoin
public static com.endeca.mdex.lql_parser.types.InnerJoin makeInnerJoin(com.endeca.mdex.lql_parser.types.SourceBase left, com.endeca.mdex.lql_parser.types.SourceBase right, com.endeca.mdex.lql_parser.types.ExpressionBase condition)
left
- Source to joinright
- Source to joincondition
- Expression to join on. (For example a ComparrisonExpression representing
"key1 = key2")
public static com.endeca.mdex.lql_parser.types.Where makeWhere(com.endeca.mdex.lql_parser.types.ExpressionBase filter)
filter
- Expression to filter by.
public static com.endeca.mdex.lql_parser.types.ComparisonExpression makeEquals(java.lang.String key, com.endeca.mdex.lql_parser.types.ExpressionBase rhs)
key
- Attribute key to use in the comparrison function.rhs
- the expression to compare the attribute to
public static com.endeca.mdex.lql_parser.types.AndExpression makeAnd(com.endeca.mdex.lql_parser.types.ExpressionBase left, com.endeca.mdex.lql_parser.types.ExpressionBase right)
left
- Expression to ANDright
- Expression to AND
public static com.endeca.mdex.lql_parser.types.OrExpression makeOr(com.endeca.mdex.lql_parser.types.ExpressionBase left, com.endeca.mdex.lql_parser.types.ExpressionBase right)
left
- Expression to ORright
- Expression to OR
public static com.endeca.mdex.lql_parser.types.GroupByList makeGroupByList(java.lang.String... groupKeys)
groupKeys
-
public static com.endeca.mdex.lql_parser.types.GroupBy makeGroupBy(java.lang.String key)
key
- Attribute key to group by
public static com.endeca.mdex.lql_parser.types.GroupBy makeGroupBy(java.lang.String key, java.math.BigInteger depth)
key
- Attribute key to group bydepth
- Tree depth in a manage attribute to limit the group by value on
public static com.endeca.mdex.lql_parser.types.OrderByList makeOrderByList(com.endeca.mdex.lql_parser.types.OrderBy... orderBys)
orderBys
-
public static com.endeca.mdex.lql_parser.types.OrderByList makeOrderByList(java.lang.String attributeKey, boolean isAscending)
attributeKey
- isAscending
-
public static com.endeca.mdex.lql_parser.types.OrderBy makeOrderBy(java.lang.String attributeKey, boolean isAscending)
attributeKey
- Attribute key to sort onisAscending
- True if the ordering should be ascending, false if descending
public static com.endeca.mdex.lql_parser.types.DoubleLiteral makeDoubleLiteral(java.lang.Double value)
value
-
public static com.endeca.mdex.lql_parser.types.ComparisonExpression makeComparisonExpression(com.endeca.mdex.lql_parser.types.ExpressionBase left, com.endeca.mdex.lql_parser.types.ExpressionBase right, LQLBuilder.CompareOp op)
op
- left
- right
-
public static com.endeca.mdex.lql_parser.types.AdditiveExpression makeAdditiveExpression(com.endeca.mdex.lql_parser.types.ExpressionBase left, com.endeca.mdex.lql_parser.types.ExpressionBase right, LQLBuilder.AdditiveOp op)
left
- right
- op
-
public static com.endeca.mdex.lql_parser.types.Paging makePaging(java.math.BigInteger offset, java.math.BigInteger count)
offset
- The offset into the entire record set.count
- The number of records that should be returned.
public static com.endeca.mdex.lql_parser.types.Having makeHaving(com.endeca.mdex.lql_parser.types.ExpressionBase filter)
filter
- Filter to restrict the results by.
public static com.endeca.mdex.lql_parser.types.FunctionCallExpression makeFunctionCallExpression(LQLBuilder.Function f, com.endeca.mdex.lql_parser.types.Where w, com.endeca.mdex.lql_parser.types.ExpressionBase... args)
LQLBuilder.Function
s. An
equivalent string form could be "count(1)"
f
- Function to use for the expressionw
- Where filter that should be applied to the functionargs
- ExpressionBase arguments to pass into the function
public static com.endeca.mdex.lql_parser.types.FunctionCallExpression makeFunctionCallExpression(LQLBuilder.Function f, com.endeca.mdex.lql_parser.types.ExpressionBase... args)
LQLBuilder.Function
s. An
equivalent string form could be "count(1)"
f
- Function to use for the expressionargs
- ExpressionBase arguments to pass into the function
public static com.endeca.mdex.lql_parser.types.BooleanLiteral makeBooleanLiteral(java.lang.String value)
public static com.endeca.mdex.lql_parser.types.BooleanLiteral makeBooleanLiteral(boolean value)
public static com.endeca.mdex.lql_parser.types.IntegerLiteral makeIntegerLiteral(java.math.BigInteger value)
public static com.endeca.mdex.lql_parser.types.DoubleLiteral makeDoubleLiteral(java.lang.String d)
public static com.endeca.mdex.lql_parser.types.StringLiteral makeStringLiteral(java.lang.String value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |