Class SqlGenerator
- java.lang.Object
-
- org.intermine.objectstore.intermine.SqlGenerator
-
public final class SqlGenerator extends java.lang.Object
Code to generate an sql statement from a Query object.- Author:
- Matthew Wakeling, Andrew Varley, Richard Smith
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SqlGenerator.State
Internal representation of the State of the query as it is built up.
-
Field Summary
Fields Modifier and Type Field Description static int
ID_ONLY
IDs onlystatic int
MAX_BAG_INLINE_SIZE
The maximum size a bag in a BagConstraint can be before we consider using a temporary table instead.static int
NO_ALIASES_ALL_FIELDS
I DON'T KNOWstatic int
QUERY_FOR_COUNTING
subquery only for counting.static int
QUERY_FOR_GOFASTER
query for go fasterstatic int
QUERY_FOR_PRECOMP
query for precomputingstatic int
QUERY_NORMAL
normal querystatic int
QUERY_SUBQUERY_CONSTRAINT
subquery in CONSTRAINTstatic int
QUERY_SUBQUERY_EXISTS
subquery existsstatic int
QUERY_SUBQUERY_FROM
subquery in FROMstatic int
SAFENESS_ANTISAFE
Safeness value indicating a situation safe for ContainsConstraint DOES NOT CONTAINstatic int
SAFENESS_SAFE
Safeness value indicating a situation safe for ContainsConstraint CONTAINSstatic int
SAFENESS_UNSAFE
Safeness value indicating a situation unsafe for ContainsConstraintprotected static java.util.Map<DatabaseSchema,java.util.Map<Query,org.intermine.objectstore.intermine.SqlGenerator.CacheEntry>>
sqlCache
protected static java.util.Map<DatabaseSchema,java.util.Map<Query,java.util.Set<java.lang.Object>>>
tablenamesCache
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
bagConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, BagConstraint c, Query q, DatabaseSchema schema, int safeness)
Converts a BagConstraint object into a String suitable for putting on an SQL query.protected static void
buildFromComponent(SqlGenerator.State state, Query q, DatabaseSchema schema, java.util.Map<java.lang.Object,java.lang.String> bagTableNames)
Builds the FROM list for the SQL query.protected static java.lang.String
buildGroupBy(Query q, DatabaseSchema schema, SqlGenerator.State state)
Builds a String representing the GROUP BY component of the Sql query.protected static java.lang.String
buildOrderBy(SqlGenerator.State state, Query q, DatabaseSchema schema, int kind)
Builds a String representing the ORDER BY component of the Sql query.protected static java.lang.String
buildSelectComponent(SqlGenerator.State state, Query q, DatabaseSchema schema, int kind)
Builds a String representing the SELECT component of the Sql query.protected static void
buildWhereClause(SqlGenerator.State state, Query q, Constraint c, DatabaseSchema schema)
Builds the WHERE clause for the SQL query.protected static void
classConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ClassConstraint c, Query q, DatabaseSchema schema)
Converts a ClassConstraint object into a String suitable for putting in an SQL query.protected static boolean
completelyFalse(Constraint con)
Returns true if this constraint is always false, regardless of row values.protected static boolean
completelyTrue(Constraint con)
Returns true if this constraint is always true, regardless of row values.protected static void
constraintSetToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ConstraintSet c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets)
Converts a ConstraintSet object into a String suitable for putting in an SQL query.protected static void
constraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, Constraint c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets)
Converts a Constraint object into a String suitable for putting in an SQL query.protected static void
containsConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ContainsConstraint c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets)
Converts a ContainsConstraint object into a String suitable for putting in an SQL query.static java.util.Set<java.lang.String>
findTableNames(Query q, DatabaseSchema schema)
Builds a Set of all table names that are touched by a given query.static java.util.Set<java.lang.Object>
findTableNames(Query q, DatabaseSchema schema, boolean individualOsbs)
Builds a Set of all table names that are touched by a given query.static java.lang.String
generate(Query q, int start, int limit, DatabaseSchema schema, Database db, java.util.Map<java.lang.Object,java.lang.String> bagTableNames)
Converts a Query object into an SQL String.static java.lang.String
generate(Query q, DatabaseSchema schema, Database db, Constraint offsetCon, int kind, java.util.Map<java.lang.Object,java.lang.String> bagTableNames)
Converts a Query object into an SQL String.static java.lang.String
generateQueryForId(java.lang.Integer id, java.lang.Class<?> clazz, DatabaseSchema schema)
Generates a query to retrieve a single object from the database, by id.protected static Constraint
getOffsetConstraint(Query q, QueryOrderable firstOrderBy, java.lang.Object value, DatabaseSchema schema)
Create a constraint to add to the main query to deal with offset - this is based on the first element in the order by (field) and a given value (x).protected static void
multipleInBagConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, MultipleInBagConstraint c, Query q, int safeness)
Converts a BagConstraint object into a String suitable for putting on an SQL query.protected static boolean
needsDistinct(Query q)
Returns true if this query requires a DISTINCT keyword in the generated SQL.static void
objectToString(java.lang.StringBuffer buffer, java.lang.Object value)
Converts an Object to a String, in a form suitable for SQL.protected static void
overlapConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, OverlapConstraint c, Query q, DatabaseSchema schema, int safeness)
Converts an OverlapConstraint to a String suitable for putting in an SQL query.protected static void
queryClassToString(java.lang.StringBuffer buffer, QueryClass qc, Query q, DatabaseSchema schema, int kind, SqlGenerator.State state)
Converts a QueryClass to a String.protected static void
queryEvaluableToString(java.lang.StringBuffer buffer, QueryEvaluable node, Query q, SqlGenerator.State state)
Converts a QueryEvaluable into a String suitable for an SQL query String.static void
registerOffset(Query q, int start, DatabaseSchema schema, Database db, java.lang.Object value, java.util.Map<java.lang.Object,java.lang.String> bagTableNames)
Registers an offset for a given query.protected static void
simpleConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SimpleConstraint c, Query q)
Converts a SimpleConstraint object into a String suitable for putting in an SQL query.protected static void
subqueryConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SubqueryConstraint c, Query q, DatabaseSchema schema)
Converts a SubqueryConstraint object into a String suitable for putting in an SQL query.protected static void
subqueryExistsConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SubqueryExistsConstraint c, DatabaseSchema schema)
Converts a SubqueryExistsConstraint object into a String suitable for putting in an SQL query.static java.lang.String
tableNameForId(java.lang.Class<?> clazz, DatabaseSchema schema)
Returns the table name used by the ID fetch query.protected static boolean[]
whereHavingSafe(java.lang.Object o, Query q)
Returns an array containing two boolean values.
-
-
-
Field Detail
-
QUERY_NORMAL
public static final int QUERY_NORMAL
normal query- See Also:
- Constant Field Values
-
QUERY_SUBQUERY_FROM
public static final int QUERY_SUBQUERY_FROM
subquery in FROM- See Also:
- Constant Field Values
-
QUERY_SUBQUERY_CONSTRAINT
public static final int QUERY_SUBQUERY_CONSTRAINT
subquery in CONSTRAINT- See Also:
- Constant Field Values
-
ID_ONLY
public static final int ID_ONLY
IDs only- See Also:
- Constant Field Values
-
NO_ALIASES_ALL_FIELDS
public static final int NO_ALIASES_ALL_FIELDS
I DON'T KNOW- See Also:
- Constant Field Values
-
QUERY_FOR_PRECOMP
public static final int QUERY_FOR_PRECOMP
query for precomputing- See Also:
- Constant Field Values
-
QUERY_SUBQUERY_EXISTS
public static final int QUERY_SUBQUERY_EXISTS
subquery exists- See Also:
- Constant Field Values
-
QUERY_FOR_GOFASTER
public static final int QUERY_FOR_GOFASTER
query for go faster- See Also:
- Constant Field Values
-
QUERY_FOR_COUNTING
public static final int QUERY_FOR_COUNTING
subquery only for counting. SELECT COUNT(*) AS ... FROM (subquery)- See Also:
- Constant Field Values
-
sqlCache
protected static java.util.Map<DatabaseSchema,java.util.Map<Query,org.intermine.objectstore.intermine.SqlGenerator.CacheEntry>> sqlCache
-
tablenamesCache
protected static java.util.Map<DatabaseSchema,java.util.Map<Query,java.util.Set<java.lang.Object>>> tablenamesCache
-
SAFENESS_SAFE
public static final int SAFENESS_SAFE
Safeness value indicating a situation safe for ContainsConstraint CONTAINS- See Also:
- Constant Field Values
-
SAFENESS_ANTISAFE
public static final int SAFENESS_ANTISAFE
Safeness value indicating a situation safe for ContainsConstraint DOES NOT CONTAIN- See Also:
- Constant Field Values
-
SAFENESS_UNSAFE
public static final int SAFENESS_UNSAFE
Safeness value indicating a situation unsafe for ContainsConstraint- See Also:
- Constant Field Values
-
MAX_BAG_INLINE_SIZE
public static final int MAX_BAG_INLINE_SIZE
The maximum size a bag in a BagConstraint can be before we consider using a temporary table instead.- See Also:
- Constant Field Values
-
-
Method Detail
-
generateQueryForId
public static java.lang.String generateQueryForId(java.lang.Integer id, java.lang.Class<?> clazz, DatabaseSchema schema) throws ObjectStoreException
Generates a query to retrieve a single object from the database, by id.- Parameters:
id
- the id of the object to fetchclazz
- a Class of the object - if unsure use InterMineObjectschema
- the DatabaseSchema- Returns:
- a String suitable for passing to an SQL server
- Throws:
ObjectStoreException
- if the given class is not in the model
-
tableNameForId
public static java.lang.String tableNameForId(java.lang.Class<?> clazz, DatabaseSchema schema) throws ObjectStoreException
Returns the table name used by the ID fetch query.- Parameters:
clazz
- the Class of the objectschema
- the DatabaseSchema- Returns:
- a table name
- Throws:
ObjectStoreException
- if the given class is not in the model
-
registerOffset
public static void registerOffset(Query q, int start, DatabaseSchema schema, Database db, java.lang.Object value, java.util.Map<java.lang.Object,java.lang.String> bagTableNames)
Registers an offset for a given query. This is used later on to speed up queries that use big offsets.- Parameters:
q
- the Querystart
- the offsetschema
- the DatabaseSchema in which to look up metadatadb
- the Database that the ObjectStore usesvalue
- a value, such that adding a WHERE component first_order_field > value with OFFSET 0 is equivalent to the original query with OFFSET offsetbagTableNames
- a Map from BagConstraints to table names, where the table contains the contents of the bag that are relevant for the BagConstraint
-
getOffsetConstraint
protected static Constraint getOffsetConstraint(Query q, QueryOrderable firstOrderBy, java.lang.Object value, DatabaseSchema schema)
Create a constraint to add to the main query to deal with offset - this is based on the first element in the order by (field) and a given value (x). If the order by element cannot have null values this is: 'field > x'. If field can have null values *and* it has not already been constrained as 'NOT NULL' in the main query it is: '(field > x or field IS NULL'.- Parameters:
q
- the QueryfirstOrderBy
- the offset element of the query's order by listvalue
- a value, such that adding a WHERE component first_order_field > value with OFFSET 0 is equivalent to the original query with OFFSET offsetschema
- the DatabaseSchema in which to look up metadata- Returns:
- the constraint(s) to add to the main query
-
generate
public static java.lang.String generate(Query q, int start, int limit, DatabaseSchema schema, Database db, java.util.Map<java.lang.Object,java.lang.String> bagTableNames) throws ObjectStoreException
Converts a Query object into an SQL String. To produce an SQL query that does not have OFFSET and LIMIT clauses, set start to 0, and limit to Integer.MAX_VALUE.- Parameters:
q
- the Query to convertstart
- the number of the first row for the query to return, numbered from zerolimit
- the maximum number of rows for the query to returnschema
- the DatabaseSchema in which to look up metadatadb
- the Database that the ObjectStore usesbagTableNames
- a Map from BagConstraints to table names, where the table contains the contents of the bag that are relevant for the BagConstraint- Returns:
- a String suitable for passing to an SQL server
- Throws:
ObjectStoreException
- if something goes wrong
-
generate
public static java.lang.String generate(Query q, DatabaseSchema schema, Database db, Constraint offsetCon, int kind, java.util.Map<java.lang.Object,java.lang.String> bagTableNames) throws ObjectStoreException
Converts a Query object into an SQL String.- Parameters:
q
- the Query to convertschema
- the DatabaseSchema in which to look up metadatadb
- the Database that the ObjectStore usesoffsetCon
- an additional constraint for improving the speed of large offsetskind
- Query typebagTableNames
- a Map from BagConstraints to table names, where the table contains the contents of the bag that are relevant for the BagConstraint- Returns:
- a String suitable for passing to an SQL server
- Throws:
ObjectStoreException
- if something goes wrong
-
needsDistinct
protected static boolean needsDistinct(Query q)
Returns true if this query requires a DISTINCT keyword in the generated SQL.- Parameters:
q
- the Query- Returns:
- a boolean
-
findTableNames
public static java.util.Set<java.lang.String> findTableNames(Query q, DatabaseSchema schema) throws ObjectStoreException
Builds a Set of all table names that are touched by a given query.- Parameters:
q
- the Queryschema
- the DatabaseSchema in which to look up metadata- Returns:
- a Set of table names
- Throws:
ObjectStoreException
- if something goes wrong
-
findTableNames
public static java.util.Set<java.lang.Object> findTableNames(Query q, DatabaseSchema schema, boolean individualOsbs) throws ObjectStoreException
Builds a Set of all table names that are touched by a given query.- Parameters:
q
- the Queryschema
- the DatabaseSchema in which to look up metadataindividualOsbs
- if true, adds individual ObjectStoreBags to the Set, otherwise just adds the table name instead- Returns:
- a Set of table names
- Throws:
ObjectStoreException
- if something goes wrong
-
buildFromComponent
protected static void buildFromComponent(SqlGenerator.State state, Query q, DatabaseSchema schema, java.util.Map<java.lang.Object,java.lang.String> bagTableNames) throws ObjectStoreException
Builds the FROM list for the SQL query.- Parameters:
state
- the current Sql Query stateq
- the Queryschema
- the DatabaseSchema in which to look up metadatabagTableNames
- a Map from BagConstraint to temporary table name- Throws:
ObjectStoreException
- if something goes wrong
-
buildWhereClause
protected static void buildWhereClause(SqlGenerator.State state, Query q, Constraint c, DatabaseSchema schema) throws ObjectStoreException
Builds the WHERE clause for the SQL query.- Parameters:
state
- the current Sql Query stateq
- the Queryc
- the Constraintschema
- the DatabaseSchema in which to look up metadata- Throws:
ObjectStoreException
- if something goes wrong
-
whereHavingSafe
protected static boolean[] whereHavingSafe(java.lang.Object o, Query q) throws ObjectStoreException
Returns an array containing two boolean values. The first is whether this object is suitable for use in a WHERE clause, and the second is whether the object is suitable for use in a HAVING clause.- Parameters:
o
- an Object of some kindq
- the current Query- Returns:
- an array of two booleans
- Throws:
ObjectStoreException
- if the object type is not recognised
-
completelyTrue
protected static boolean completelyTrue(Constraint con) throws ObjectStoreException
Returns true if this constraint is always true, regardless of row values.- Parameters:
con
- a Constraint- Returns:
- a boolean
- Throws:
ObjectStoreException
- when a bag contains elements of the wrong type
-
completelyFalse
protected static boolean completelyFalse(Constraint con) throws ObjectStoreException
Returns true if this constraint is always false, regardless of row values.- Parameters:
con
- a Constraint- Returns:
- a boolean
- Throws:
ObjectStoreException
- when a bag contains elements of the wrong type
-
constraintToString
protected static void constraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, Constraint c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets) throws ObjectStoreException
Converts a Constraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the Constraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadatasafeness
- the ContainsConstraint safeness parameterloseBrackets
- true if an AND ConstraintSet can be represented safely without surrounding parentheses- Throws:
ObjectStoreException
- if something goes wrong
-
constraintSetToString
protected static void constraintSetToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ConstraintSet c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets) throws ObjectStoreException
Converts a ConstraintSet object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the ConstraintSet objectq
- the Queryschema
- the DatabaseSchema in which to look up metadatasafeness
- the ContainsConstraint safeness parameterloseBrackets
- true if an AND ConstraintSet can be represented safely without surrounding parentheses- Throws:
ObjectStoreException
- if something goes wrong
-
simpleConstraintToString
protected static void simpleConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SimpleConstraint c, Query q) throws ObjectStoreException
Converts a SimpleConstraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the SimpleConstraint objectq
- the Query- Throws:
ObjectStoreException
- if something goes wrong
-
subqueryConstraintToString
protected static void subqueryConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SubqueryConstraint c, Query q, DatabaseSchema schema) throws ObjectStoreException
Converts a SubqueryConstraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the SubqueryConstraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadata- Throws:
ObjectStoreException
- if something goes wrong
-
subqueryExistsConstraintToString
protected static void subqueryExistsConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, SubqueryExistsConstraint c, DatabaseSchema schema) throws ObjectStoreException
Converts a SubqueryExistsConstraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the SubqueryExistsConstraint objectschema
- the DatabaseSchema in which to look up metadata- Throws:
ObjectStoreException
- if something goes wrong
-
classConstraintToString
protected static void classConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ClassConstraint c, Query q, DatabaseSchema schema) throws ObjectStoreException
Converts a ClassConstraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the ClassConstraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadata- Throws:
ObjectStoreException
- if something goes wrong
-
containsConstraintToString
protected static void containsConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, ContainsConstraint c, Query q, DatabaseSchema schema, int safeness, boolean loseBrackets) throws ObjectStoreException
Converts a ContainsConstraint object into a String suitable for putting in an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the ContainsConstraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadatasafeness
- the ContainsConstraint safeness parameterloseBrackets
- true if an AND ConstraintSet can be represented safely without surrounding parentheses- Throws:
ObjectStoreException
- if something goes wrong
-
bagConstraintToString
protected static void bagConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, BagConstraint c, Query q, DatabaseSchema schema, int safeness) throws ObjectStoreException
Converts a BagConstraint object into a String suitable for putting on an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the BagConstraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadatasafeness
- the constraint context safeness- Throws:
ObjectStoreException
- if something goes wrong
-
multipleInBagConstraintToString
protected static void multipleInBagConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, MultipleInBagConstraint c, Query q, int safeness) throws ObjectStoreException
Converts a BagConstraint object into a String suitable for putting on an SQL query.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the BagConstraint objectq
- the Querysafeness
- the constraint context safeness- Throws:
ObjectStoreException
- if something goes wrong
-
overlapConstraintToString
protected static void overlapConstraintToString(SqlGenerator.State state, java.lang.StringBuffer buffer, OverlapConstraint c, Query q, DatabaseSchema schema, int safeness) throws ObjectStoreException
Converts an OverlapConstraint to a String suitable for putting in an SQL query. This will try to use a Postgres range type column first, if not present it will try BioSeg, if not present it will use simple constraints on start and end fields.- Parameters:
state
- the current SqlGenerator statebuffer
- the StringBuffer to place text intoc
- the OverlapConstraint objectq
- the Queryschema
- the DatabaseSchema in which to look up metadatasafeness
- the constraint context safeness- Throws:
ObjectStoreException
- if something goes wrong
-
objectToString
public static void objectToString(java.lang.StringBuffer buffer, java.lang.Object value) throws ObjectStoreException
Converts an Object to a String, in a form suitable for SQL.- Parameters:
buffer
- a StringBuffer to add text tovalue
- the Object to convert- Throws:
ObjectStoreException
- if something goes wrong
-
queryClassToString
protected static void queryClassToString(java.lang.StringBuffer buffer, QueryClass qc, Query q, DatabaseSchema schema, int kind, SqlGenerator.State state) throws ObjectStoreException
Converts a QueryClass to a String.- Parameters:
buffer
- the StringBuffer to add text toqc
- the QueryClass to convertq
- the Queryschema
- the DatabaseSchema in which to look up metadatakind
- the type of the output requestedstate
- a State object- Throws:
ObjectStoreException
- if the model is internally inconsistent
-
queryEvaluableToString
protected static void queryEvaluableToString(java.lang.StringBuffer buffer, QueryEvaluable node, Query q, SqlGenerator.State state) throws ObjectStoreException
Converts a QueryEvaluable into a String suitable for an SQL query String.- Parameters:
buffer
- the StringBuffer to add text tonode
- the QueryEvaluableq
- the Querystate
- a State object- Throws:
ObjectStoreException
- if something goes wrong
-
buildSelectComponent
protected static java.lang.String buildSelectComponent(SqlGenerator.State state, Query q, DatabaseSchema schema, int kind) throws ObjectStoreException
Builds a String representing the SELECT component of the Sql query.- Parameters:
state
- the current Sql Query stateq
- the Queryschema
- the DatabaseSchema in which to look up metadatakind
- the kind of output requested- Returns:
- a String
- Throws:
ObjectStoreException
- if something goes wrong
-
buildGroupBy
protected static java.lang.String buildGroupBy(Query q, DatabaseSchema schema, SqlGenerator.State state) throws ObjectStoreException
Builds a String representing the GROUP BY component of the Sql query.- Parameters:
q
- the Queryschema
- the DatabaseSchema in which to look up metadatastate
- a State object- Returns:
- a String
- Throws:
ObjectStoreException
- if something goes wrong
-
buildOrderBy
protected static java.lang.String buildOrderBy(SqlGenerator.State state, Query q, DatabaseSchema schema, int kind) throws ObjectStoreException
Builds a String representing the ORDER BY component of the Sql query.- Parameters:
state
- the current Sql Query stateq
- the Queryschema
- the DatabaseSchema in which to look up metadatakind
- the kind of output requested- Returns:
- a String
- Throws:
ObjectStoreException
- if something goes wrong
-
-