Package org.sqlproc.engine.impl
Class SqlMetaOrd
java.lang.Object
org.sqlproc.engine.impl.SqlMetaOrd
- All Implemented Interfaces:
SqlMetaElement
A META SQL sub-element. It represents the ORDER command of the final ANSI SQL.
Schematically:
SqlMetaOrd SqlMetaText SqlMetaIdent SqlMetaConst
- Author:
- Vladimir Hudec
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List
<SqlMetaSimple> The list of sub-elements based on ANTLR grammar.(package private) String
The ordering id.(package private) final org.slf4j.Logger
The internal slf4j logger.Fields inherited from interface org.sqlproc.engine.impl.SqlMetaElement
AND_PREFIX, CONST_PREFIX, IDENT_PREFIX, IDENT_SEPARATOR, lCONST_PREFIX, lIDENT_PREFIX, OR_PREFIX, SET_PREFIX, VALUES_PREFIX, WHERE_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addElement
(SqlMetaSimple element) Adds a new sub-element.private StringBuilder
process
(StringBuilder sql, SqlOrder.Order orderDirrection) Returns ANSI SQL ORDER command for one ordering rule.process
(SqlProcessContext ctx) The main contract for a dynamic ANSI SQL Query generation.
-
Field Details
-
logger
final org.slf4j.Logger loggerThe internal slf4j logger. -
elements
List<SqlMetaSimple> elementsThe list of sub-elements based on ANTLR grammar. -
id
String idThe ordering id. This value should correspond to the order number in META SQL {#NNN order by ...}.
-
-
Constructor Details
-
SqlMetaOrd
SqlMetaOrd(String id) Creates a new instance. It's used from inside ANTLR parser.- Parameters:
id
- the ordering id, which corresponds to the order number in META SQL {#NNN order by ...}
-
-
Method Details
-
addElement
Adds a new sub-element. It's used from inside ANTLR parser.- Parameters:
element
- new sub-element, based on ANTLR grammar
-
process
Returns ANSI SQL ORDER command for one ordering rule.- Parameters:
sql
- the cumulative fragment of the final ordering commandorderDirrection
- the ASC or DESC ordering direction- Returns:
- the cumulative fragment of the final ordering command
-
process
The main contract for a dynamic ANSI SQL Query generation. Also known as a META SQL processing. The composite pattern main contract. All ANTLR grammar based elements must implement this contract.- Specified by:
process
in interfaceSqlMetaElement
- Parameters:
ctx
- the crate for all input parameters and the context of processing
-