public class OQLQuery extends java.lang.Object implements CompiledQueryI
Note: This engine utilizes a two-tier soft-reference cache to maximize throughput:
SQLQuery is cached.$1), the parsed AST (OQLQuery) is cached,
allowing subsequent calls to rapidly generate new SQLQuery objects with different arguments
without re-parsing the grammar.Usage:
SQLQuery sqlQuery = OQLQuery.compile(schema, "select a from BO a", args);
| Constructor and Description |
|---|
OQLQuery(SchemaI schema,
java.lang.String queryString)
Parses a raw OQL string into an internal Abstract Syntax Tree (AST).
|
| Modifier and Type | Method and Description |
|---|---|
static SQLQuery |
compile(SchemaI schema,
java.lang.String queryString,
java.lang.Object[] oqlArgs)
Compiles an OQL string into a fully executable JDBC SQL query, utilizing the memory-sensitive cache.
|
int |
getExpectedRows(java.lang.Object[] oqlArgs) |
static int |
getExpectedRows(QueryExpressionNode parsedTree,
java.lang.Object[] oqlArgs)
Attempts to heuristically determine the expected row count from the AST nodes.
|
SQLQuery |
getOrComputeLocalizedSQL(de.ipcon.db.oql.OQLQuery.LocaleCacheKey key)
Resolves or generates the rendered SQLQuery for the specified locale context.
|
QueryExpressionNode |
getParsedTree() |
SchemaI |
getSchema() |
boolean |
isLocalizationRelevant()
Returns true if the query references L10nedString, hstore columns, or virtual fallback tokens.
|
SQLQuery |
toSQLQuery(java.lang.Object[] oqlArgs,
java.lang.String oqlQuery)
Resolves or renders the executable
SQLQuery for the given invocation arguments. |
public OQLQuery(SchemaI schema, java.lang.String queryString) throws OQLException
schema - The schema definition used for type resolutionqueryString - The raw OQL string to parseOQLException - if the syntax is invalid or type resolution failspublic boolean isLocalizationRelevant()
public SQLQuery getOrComputeLocalizedSQL(de.ipcon.db.oql.OQLQuery.LocaleCacheKey key)
public static SQLQuery compile(SchemaI schema, java.lang.String queryString, java.lang.Object[] oqlArgs) throws OQLException
schema - The schema definitionqueryString - The raw OQL stringoqlArgs - The positional arguments mapped to the OQL variablesOQLException - if query syntax is invalid or compilation failspublic SchemaI getSchema()
public QueryExpressionNode getParsedTree()
public SQLQuery toSQLQuery(java.lang.Object[] oqlArgs, java.lang.String oqlQuery)
CompiledQueryISQLQuery for the given invocation arguments.toSQLQuery in interface CompiledQueryIoqlArgs - positional runtime parameters mapped to OQL variablesoqlQuery - the original OQL query string (used for diagnostics and warnings)public int getExpectedRows(java.lang.Object[] oqlArgs)
public static int getExpectedRows(QueryExpressionNode parsedTree, java.lang.Object[] oqlArgs)
SQLQuery.NO_LIMIT if statically indeterminateCopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.