Package com.j_spaces.jdbc.builder
Class QueryTemplateBuilder
java.lang.Object
com.j_spaces.jdbc.builder.QueryTemplateBuilder
- All Implemented Interfaces:
Externalizable,Serializable
Builds an external entry from
ExpNode The builder converts the expression tree to ranges.
The ranges are optimized , merged and attached to the expression node.- Author:
- anna
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBuild QueryTemplatePacket fromAndNodevoidbuild(ColumnNode node) Build QueryTemplatePacket fromAndNodevoidBuild QueryTemplatePacket fromExpNodevoidBuild QueryTemplatePacket fromExpNodevoidBuild QueryTemplatePacket fromInNode(special conversion)voidBuild QueryTemplatePacket fromLikeNode(special conversion)voidBuild QueryTemplatePacket fromNotInNode(special conversion)voidbuild(NotLikeNode node) Special build for not like - since it can't be translated to a space template.voidBuild QueryTemplatePacket fromOrNodevoidbuild(RelationNode node) voidvoidbuildContainsTemplate(ContainsNode containsNode) Build QueryTemplatePacket for contains.static QueryTemplatePacketbuildTemplate(InNode node, AbstractDMLQuery query) buildTemplate(LiteralNode node, QueryColumnData queryColumnData, short op, short nullOp, FunctionCallDescription functionCallDescription, ExpNode father) Build space templatestatic QueryTemplatePacketbuildTemplate(NotInNode node, AbstractDMLQuery query) voidstatic RangetoRange(String colName, FunctionCallDescription functionCallDescription, Object value, short matchCode) Converts single external entry expression to a rangestatic RangetoRange(String colName, FunctionCallDescription functionCallDescription, Object value, short matchCode, ExpNode node, AbstractDMLQuery query) voidTraverse the binary expression tree non-recursively using a custom stack The tree has to be traversed in postorder - the parent is traversed after its children.void
-
Constructor Details
-
QueryTemplateBuilder
public QueryTemplateBuilder() -
QueryTemplateBuilder
- Parameters:
query-
-
-
Method Details
-
buildContainsTemplate
Build QueryTemplatePacket for contains. (syntax: "collection[*] = ?") Validate that the column associated with the argument is not an embedded object's column.- Throws:
SQLException
-
buildContainsItemsRootTemplate
- Throws:
SQLException
-
build
Build QueryTemplatePacket fromExpNode- Throws:
SQLException
-
build
- Throws:
SQLException
-
build
Build QueryTemplatePacket fromExpNode- Throws:
SQLException
-
build
Build QueryTemplatePacket fromLikeNode(special conversion)- Throws:
SQLException
-
build
Build QueryTemplatePacket fromInNode(special conversion)- Throws:
SQLException
-
build
Build QueryTemplatePacket fromNotInNode(special conversion)- Throws:
SQLException
-
buildTemplate
public static QueryTemplatePacket buildTemplate(NotInNode node, AbstractDMLQuery query) throws SQLException - Returns:
- QueryTemplatePacket
- Throws:
SQLException
-
buildTemplate
public static QueryTemplatePacket buildTemplate(InNode node, AbstractDMLQuery query) throws SQLException - Returns:
- QueryTemplatePacket
- Throws:
SQLException
-
buildTemplate
public QueryTemplatePacket buildTemplate(LiteralNode node, QueryColumnData queryColumnData, short op, short nullOp, FunctionCallDescription functionCallDescription, ExpNode father) throws SQLException Build space template- Throws:
SQLException
-
toRange
public static Range toRange(String colName, FunctionCallDescription functionCallDescription, Object value, short matchCode) Converts single external entry expression to a range- Returns:
- Range
-
toRange
public static Range toRange(String colName, FunctionCallDescription functionCallDescription, Object value, short matchCode, ExpNode node, AbstractDMLQuery query) -
build
Build QueryTemplatePacket fromAndNode- Throws:
SQLException
-
build
Build QueryTemplatePacket fromOrNode- Throws:
SQLException
-
traverseExpressionTree
Traverse the binary expression tree non-recursively using a custom stack The tree has to be traversed in postorder - the parent is traversed after its children.- Throws:
SQLException
-
build
Special build for not like - since it can't be translated to a space template. The query- Throws:
SQLException
-
build
Build QueryTemplatePacket fromAndNode- Throws:
SQLException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-