public class SQLQuery
extends java.lang.Object
The design allows generating multiple distinct SQLQuery objects from a single parsed OQL query (e.g. varying parameter lists) without altering the AST.
| Modifier and Type | Field and Description |
|---|---|
static org.apache.log4j.Logger |
log |
static int |
NO_LIMIT |
| Constructor and Description |
|---|
SQLQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.Class<?> resultClass,
int expectedRows)
Constructs a basic SQL query without specific limits or sorting.
|
SQLQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.Class<?> resultClass,
int expectedRows,
int limit,
boolean sorted,
FilterNode filterPart)
Constructs a fully specified SQL query.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object[] |
getArgs()
Returns the positional parameters for JDBC execution.
|
int |
getExpectedRows() |
java.util.function.Predicate<BOI> |
getFilterPredicate() |
int |
getLimit() |
java.lang.String |
getQuery() |
java.lang.Class<?> |
getResultClass() |
boolean |
isSorted() |
static SQLQuery |
ofOQL(SchemaI schema,
java.lang.String oqlQuery,
java.lang.Object[] parameters)
Factory method to parse an OQL query and immediately translate it to SQL.
|
public static final org.apache.log4j.Logger log
public static final int NO_LIMIT
public SQLQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.Class<?> resultClass,
int expectedRows)
query - the raw JDBC SQL stringargs - the JDBC positional parametersresultClass - the expected return entity/type classexpectedRows - the estimated row count, or -1 if unknownpublic SQLQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.Class<?> resultClass,
int expectedRows,
int limit,
boolean sorted,
FilterNode filterPart)
query - the raw JDBC SQL stringargs - the JDBC positional parametersresultClass - the expected return entity/type classexpectedRows - the estimated row count, or -1 if unknownlimit - the maximum rows to return, or -1 for no limitsorted - true if the query contains an explicit "order by" clausefilterPart - the AST node representing post-db filtering logicpublic static SQLQuery ofOQL(SchemaI schema, java.lang.String oqlQuery, java.lang.Object[] parameters) throws OQLException
schema - the schema to use for determining attribute typesoqlQuery - the raw OQL query stringparameters - the positional parameters for the OQL queryOQLException - if the OQL query could not be parsed or translatedpublic java.lang.String getQuery()
public java.lang.Object[] getArgs()
Note: Returns the internal array reference for performance reasons; do not mutate the array.
public java.lang.Class<?> getResultClass()
public int getExpectedRows()
NO_LIMIT) if unknownpublic int getLimit()
NO_LIMIT) if unboundedpublic boolean isSorted()
public java.util.function.Predicate<BOI> getFilterPredicate()
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.