public class SQLInfo extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SQLInfo.ColumnMapMaker
Builds the map from a result set given a list of columns and column keys.
|
static interface |
SQLInfo.MapMaker
Knows how to build a result map for a row given a
ResultSet . |
static class |
SQLInfo.SQLInfoSelect |
class |
SQLInfo.SQLInfoSelection
Info about how to do the query to get a
SQLInfo.SQLInfoSelection . |
Modifier and Type | Method and Description |
---|---|
void |
executeSQLStatements(String category,
JDBCConnection jdbc)
Executes the SQL statements for the given category.
|
List<Column> |
getClusterInvalidationsColumns() |
SQLInfo.SQLInfoSelect |
getCopyHier(boolean explicitName) |
Column |
getCopyIdColumn(String tableName) |
String |
getCopySql(String tableName) |
Database |
getDatabase() |
String |
getDeleteSql(String tableName)
Returns the SQL
DELETE to delete a row. |
String |
getDeleteSql(String tableName,
int n)
Returns the SQL
DELETE to delete several rows. |
List<Column> |
getInsertColumns(String tableName)
Returns the list of columns to use for an statement
getInsertSql(java.lang.String) . |
List<Column> |
getInsertRootIdColumns() |
String |
getInsertRootIdSql() |
String |
getInsertSql(String tableName)
Returns the SQL
INSERT to add a row. |
int |
getMaximumArgsForIn() |
SQLInfo.SQLInfoSelect |
getSelectAncestorsIds()
Select all ancestors ids for several fragments.
|
String |
getSelectChildrenIdsAndTypesSql(boolean onlyComplex) |
List<Column> |
getSelectChildrenIdsAndTypesWhatColumns() |
String |
getSelectDescendantsInfoSql() |
List<Column> |
getSelectDescendantsInfoWhatColumns() |
SQLInfo.SQLInfoSelect |
getSelectFragmentsByIds(String tableName,
int nids)
Select by ids for all values of several fragments.
|
SQLInfo.SQLInfoSelect |
getSelectFragmentsByIds(String tableName,
int nids,
String[] orderBys,
Set<String> skipColumns)
Select by ids for all values of several fragments (maybe ordered along
columns -- for collection fragments retrieval).
|
SQLInfo.SQLInfoSelection |
getSelection(SelectionType type) |
SQLInfo.SQLInfoSelect |
getSelectParentIds(int nids)
Select parentid by ids for all values of several fragments.
|
String |
getSelectRootIdSql() |
Column |
getSelectRootIdWhatColumn() |
SQLInfo.SQLInfoSelect |
getUpdateById(String tableName,
Collection<String> keys) |
Update |
getUpdateByIdForKeys(String tableName,
List<String> keys) |
void |
initSQLStatements(Map<String,Serializable> testProps) |
static SQLInfo.SQLInfoSelect |
makeSelect(Table table,
String[] orderBys,
String... freeColumns)
Basic SELECT x, y, z FROM table WHERE a = ? AND b = ?
|
public SQLInfo(Model model, Dialect dialect) throws StorageException
model
- the modeldialect
- the SQL dialectStorageException
public Database getDatabase()
public String getSelectRootIdSql()
public Column getSelectRootIdWhatColumn()
public String getInsertRootIdSql()
public SQLInfo.SQLInfoSelection getSelection(SelectionType type)
public String getSelectChildrenIdsAndTypesSql(boolean onlyComplex)
public List<Column> getSelectChildrenIdsAndTypesWhatColumns()
public String getSelectDescendantsInfoSql()
public String getInsertSql(String tableName)
INSERT
to add a row. The columns that represent
sequences that are implicitly auto-incremented aren't included.tableName
- the table nameINSERT
statementpublic List<Column> getInsertColumns(String tableName)
getInsertSql(java.lang.String)
.tableName
- the table namepublic SQLInfo.SQLInfoSelect getUpdateById(String tableName, Collection<String> keys)
public SQLInfo.SQLInfoSelect getSelectFragmentsByIds(String tableName, int nids)
public SQLInfo.SQLInfoSelect getSelectFragmentsByIds(String tableName, int nids, String[] orderBys, Set<String> skipColumns)
public SQLInfo.SQLInfoSelect getSelectAncestorsIds()
Fast alternative to the slowest iterative
getSelectParentIds(int)
.
public SQLInfo.SQLInfoSelect getSelectParentIds(int nids)
public String getDeleteSql(String tableName)
DELETE
to delete a row. The primary key columns
are free parameters.tableName
- the table nameDELETE
statementpublic String getDeleteSql(String tableName, int n)
DELETE
to delete several rows. The primary key
columns are free parameters.tableName
- the table namen
- the number of rows to deleteDELETE
statement with a IN
for the keyspublic SQLInfo.SQLInfoSelect getCopyHier(boolean explicitName)
public static SQLInfo.SQLInfoSelect makeSelect(Table table, String[] orderBys, String... freeColumns)
with optional ORDER BY x, y DESC
public void initSQLStatements(Map<String,Serializable> testProps) throws IOException
IOException
public void executeSQLStatements(String category, JDBCConnection jdbc) throws SQLException
SQLException
public int getMaximumArgsForIn()
Copyright © 2011 Nuxeo SA. All Rights Reserved.