| com.completex.objective.components.persistency.SelectQueryBuilder
All known Subclasses: com.completex.objective.components.persistency.core.impl.SelectQueryBuilderImpl,
SelectQueryBuilder | public interface SelectQueryBuilder (Code) | | Helper to build complete SQL SELECT statements as well as its fragments
author: Gennady Krizhevsky |
Method Summary | |
StringBuffer | concatenate(StringBuffer buffer, Object[] strings) | StringBuffer | concatenate(Object[] strings) | String | getSelectSqlFragment(PersistentObjectFactory persistentFactory) Builds SQL SELECT clause without actual "SELECT" keyword out of PersistentObjectFactory. | String | getSelectSqlHeader(PersistentObjectFactory persistentFactory, boolean distinct) Builds SQL SELECT clause out of PersistentObjectFactory. | String | getSelectSqlHeader(PersistentObjectFactory persistentFactory) Builds SQL SELECT clause out of PersistentObjectFactory. | String | getSqlCall(QueryDefinition query, DatabasePolicy policy) Builds call statement with syntax:
{ ? = call <procedure-name>[<arg1>,<arg2>, ...] }
{ call <procedure-name>[<arg1>,<arg2>, ...] }. | String | getSqlCount(Query query, DatabasePolicy policy) Builds SQL SELECT count(1) ... | String | getSqlExists(Query query, DatabasePolicy policy) Builds SQL that can be used by Persistency#selectExists(Query) method. | String | getSqlIn(String prefix, Object[] values) Builds SQL IN clause prepended by prefix. | String | getSqlIn(Object[] values) Builds SQL IN clause. | String | getSqlIn(int length) | String | getSqlSelect(Query query, DatabasePolicy policy) Builds complete SQL SELECT statement. | String | getSqlSelect(QueryDefinition query, DatabasePolicy policy) Builds complete SQL SELECT statement. | String | getWhereByPoValues(PersistentObject persistentObject, boolean primaryKeyOnly) Builds complete SQL WHERE clause out of PersistentObjectFactory. | String | getWhereByPoValuesFragment(PersistentObject persistentObject, boolean primaryKeyOnly) Builds SQL WHERE clause without actual "WHERE" keyword out of PersistentObjectFactory. | StringBuffer | in(String prefix, Object[] values) Builds SQL IN clause prepended by prefix. | StringBuffer | in(Object[] values) Builds SQL IN clause. | StringBuffer | in(int length) | StringBuffer | selectSQLHeader(PersistentObjectFactory persistentFactory, boolean distinct) Builds SQL SELECT clause out of PersistentObjectFactory. | StringBuffer | selectSQLHeader(PersistentObjectFactory persistentFactory) Builds SQL SELECT clause out of PersistentObjectFactory. | String | selectSql(PersistentObjectFactory persistentFactory) | String | whereByPersistentObjectValues(PersistentObject persistentObject, boolean primaryKeyOnly) Builds SQL WHERE clause out of PersistentObjectFactory. |
NULL_SELECT_QUERY_BUILDER | final public static NullSelectQueryBuilder NULL_SELECT_QUERY_BUILDER(Code) | | |
concatenate | StringBuffer concatenate(StringBuffer buffer, Object[] strings)(Code) | | Concatenates strings with comma as a separator
Parameters: buffer - to place concatenated result to Parameters: strings - strings to concatenate buffer concatenated strings with comma as a separator passed as a parameter |
concatenate | StringBuffer concatenate(Object[] strings)(Code) | | Concatenates strings with comma as a separator
Parameters: strings - strings to concatenate buffer concatenated strings with comma as a separator |
getSelectSqlFragment | String getSelectSqlFragment(PersistentObjectFactory persistentFactory)(Code) | | Builds SQL SELECT clause without actual "SELECT" keyword out of PersistentObjectFactory.
Parameters: persistentFactory - PersistentObjectFactory which meta data is used to build SQL SELECT clause SQL SELECT clause without actual "SELECT" keyword |
getSelectSqlHeader | String getSelectSqlHeader(PersistentObjectFactory persistentFactory, boolean distinct)(Code) | | Builds SQL SELECT clause out of PersistentObjectFactory.
Parameters: persistentFactory - PersistentObjectFactory which meta data is used to build SQL SELECT clause Parameters: distinct - if true SELECT DISTINCT clause is built SQL SELECT clause |
getSelectSqlHeader | String getSelectSqlHeader(PersistentObjectFactory persistentFactory)(Code) | | Builds SQL SELECT clause out of PersistentObjectFactory.
Parameters: persistentFactory - PersistentObjectFactory which meta data is used to build SQL SELECT clause SQL SELECT clause |
getSqlCall | String getSqlCall(QueryDefinition query, DatabasePolicy policy)(Code) | | Builds call statement with syntax:
{ ? = call <procedure-name>[<arg1>,<arg2>, ...] }
{ call <procedure-name>[<arg1>,<arg2>, ...] }. If sql is set on Query through Query.setSql(sql) method -
it will be returned.
Parameters: query - QueryDefinition Parameters: policy - DatabasePolicy call statement |
getSqlCount | String getSqlCount(Query query, DatabasePolicy policy)(Code) | | Builds SQL SELECT count(1) ... statement.
Parameters: query - Query Parameters: policy - DatabasePolicy complete SQL SELECT statement |
getSqlExists | String getSqlExists(Query query, DatabasePolicy policy)(Code) | | Builds SQL that can be used by Persistency#selectExists(Query) method.
Parameters: query - Query Parameters: policy - DatabasePolicy complete SQL that can be used by Persistency#selectExists(Query) method See Also: Persistency.selectExists(Query) |
getSqlIn | String getSqlIn(String prefix, Object[] values)(Code) | | Builds SQL IN clause prepended by prefix. Takes Object[] of not null values as an input parameter.
If value is a String it gets single quoted.
Parameters: prefix - prefix Parameters: values - Object[] of IN clause values SQL IN caluse prepended by prefix |
getSqlIn | String getSqlIn(Object[] values)(Code) | | Builds SQL IN clause. Takes Object[] of not null values as an input parameter.
If value is a String it gets single quoted.
Parameters: values - Object[] of IN clause values SQL IN caluse |
getSqlIn | String getSqlIn(int length)(Code) | | Builds SQL IN clause with placeholders
Parameters: length - numberof placeholders ('?' characters) SQL IN clause with placeholders |
getSqlSelect | String getSqlSelect(Query query, DatabasePolicy policy)(Code) | | Builds complete SQL SELECT statement. If sql is set on Query through Query.setSql(sql) method -
it will be returned.
Parameters: query - Query Parameters: policy - DatabasePolicy complete SQL SELECT statement |
getSqlSelect | String getSqlSelect(QueryDefinition query, DatabasePolicy policy)(Code) | | Builds complete SQL SELECT statement. If sql is set on Query through Query.setSql(sql) method -
it will be returned.
Parameters: query - QueryDefinition Parameters: policy - DatabasePolicy complete SQL SELECT statement |
getWhereByPoValues | String getWhereByPoValues(PersistentObject persistentObject, boolean primaryKeyOnly)(Code) | | Builds complete SQL WHERE clause out of PersistentObjectFactory.
Parameters: persistentObject - PersistentObject which meta data and data is used to build SQL SELECT clause SQL WHERE clause |
getWhereByPoValuesFragment | String getWhereByPoValuesFragment(PersistentObject persistentObject, boolean primaryKeyOnly)(Code) | | Builds SQL WHERE clause without actual "WHERE" keyword out of PersistentObjectFactory.
Parameters: persistentObject - PersistentObject which meta data and data is used to build SQL SELECT clause SQL WHERE clause without actual "WHERE" keyword out of PersistentObjectFactory. |
in | StringBuffer in(String prefix, Object[] values)(Code) | | Builds SQL IN clause prepended by prefix. Takes Object[] of not null values as an input parameter.
If value is a String it gets single quoted.
Parameters: prefix - prefix Parameters: values - Object[] of IN clause values SQL IN caluse prepended by prefix |
in | StringBuffer in(Object[] values)(Code) | | Builds SQL IN clause. Takes Object[] of not null values as an input parameter.
If value is a String it gets single quoted.
Parameters: values - Object[] of IN clause values SQL IN caluse |
in | StringBuffer in(int length)(Code) | | Builds SQL IN clause with placeholders
Parameters: length - numberof placeholders ('?' characters) SQL IN clause with placeholders |
selectSQLHeader | StringBuffer selectSQLHeader(PersistentObjectFactory persistentFactory, boolean distinct)(Code) | | Builds SQL SELECT clause out of PersistentObjectFactory.
Parameters: persistentFactory - PersistentObjectFactory which meta data is used to build SQL SELECT clause Parameters: distinct - if true SELECT DISTINCT clause is built SQL SELECT clause |
selectSQLHeader | StringBuffer selectSQLHeader(PersistentObjectFactory persistentFactory)(Code) | | Builds SQL SELECT clause out of PersistentObjectFactory.
Parameters: persistentFactory - PersistentObjectFactory which meta data is used to build SQL SELECT clause SQL SELECT clause |
whereByPersistentObjectValues | String whereByPersistentObjectValues(PersistentObject persistentObject, boolean primaryKeyOnly)(Code) | | Builds SQL WHERE clause out of PersistentObjectFactory.
Parameters: persistentObject - PersistentObject which meta data and data is used to build SQL SELECT clause SQL WHERE clause |
|
|