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
Selection . |
protected class |
SQLInfo.TableMaker |
Modifier and Type | Field and Description |
---|---|
protected List<Column> |
clusterInvalidationsColumns |
protected List<Column> |
createClusterNodeColumns |
protected String |
createClusterNodeSql |
Database |
database |
protected Column |
deleteClusterInvalsColumn |
protected String |
deleteClusterInvalsSql |
protected Column |
deleteClusterNodeColumn |
protected String |
deleteClusterNodeSql |
Dialect |
dialect |
protected List<Column> |
getBinariesColumns |
protected List<String> |
getBinariesSql |
boolean |
proxiesEnabled |
protected Map<String,SQLInfo.SQLInfoSelect> |
selectFragmentById |
boolean |
softDeleteEnabled |
protected Map<String,List<SQLStatement>> |
sqlStatements |
protected Map<String,Serializable> |
sqlStatementsProperties |
Modifier and Type | Method and Description |
---|---|
void |
executeSQLStatements(String category,
String ddlMode,
Connection connection,
JDBCLogger logger,
SQLStatement.ListCollector ddlCollector)
Executes the SQL statements for the given category.
|
List<Column> |
getClusterInvalidationsColumns() |
int |
getClusterNodeIdType() |
SQLInfo.SQLInfoSelect |
getCopyHier(boolean explicitName,
boolean resetVersion) |
Column |
getCopyIdColumn(String tableName) |
String |
getCopySql(String tableName) |
List<Column> |
getCreateClusterNodeColumns() |
String |
getCreateClusterNodeSql() |
Database |
getDatabase() |
Column |
getDeleteClusterInvalsColumn() |
String |
getDeleteClusterInvalsSql() |
Column |
getDeleteClusterNodeColumn() |
String |
getDeleteClusterNodeSql() |
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. |
String |
getIdEqualsClause(String tableName)
Returns the clause used to match a given row by id in the given table.
|
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() |
SQLInfo.SQLInfoSelect |
getSelectChildrenNodeInfos(int nids)
Selects all children (not complex) for several parent ids.
|
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() |
String |
getSoftDeleteClause()
Returns null or
AND isdeleted IS NULL if soft delete is activated. |
String |
getSoftDeleteClause(String tableName)
Returns
AND isdeleted IS NULL if this is the hierarchy table and soft delete is activated. |
String |
getSoftDeleteCleanupSql()
Returns the SQL to clean (hard-delete) soft-deleted rows.
|
String |
getSoftDeleteSql()
Returns the SQL to soft-delete several rows.
|
SQLInfo.SQLInfoSelect |
getUpdateById(String tableName,
RowMapper.RowUpdate rowu)
UPDATE tableName SET key1 = ?, key2 = ?, ...
|
Update |
getUpdateByIdForKeys(String tableName,
List<String> keys) |
protected void |
initAncestorsSQL()
Creates the SQL for the table holding ancestors information.
|
protected void |
initClusterSQL() |
protected void |
initFragmentSQL(String tableName)
Creates the SQL for one fragment (simple or collection).
|
protected void |
initHierarchySQL()
Creates the SQL for the table holding hierarchy information.
|
protected void |
initRepositorySQL()
Creates the SQL for the table holding global repository information.
|
protected void |
initSelectDescendantsSQL() |
protected void |
initSelections() |
protected void |
initSQL()
Creates all the sql from the models.
|
void |
initSQLStatements(Map<String,Serializable> testProps,
List<String> sqlInitFiles) |
SQLInfo.SQLInfoSelect |
makeSelect(Table table,
String[] orderBys,
String... freeColumns)
Basic SELECT x, y, z FROM table WHERE a = ? AND b = ?
|
SQLInfo.SQLInfoSelect |
makeSelect(Table table,
String from,
List<String> clauses,
String[] orderBys,
String... freeColumns)
Same as above but the FROM can be passed in, to allow JOINs.
|
public final boolean softDeleteEnabled
public final boolean proxiesEnabled
protected final Map<String,SQLInfo.SQLInfoSelect> selectFragmentById
protected String createClusterNodeSql
protected List<Column> createClusterNodeColumns
protected String deleteClusterNodeSql
protected Column deleteClusterNodeColumn
protected String deleteClusterInvalsSql
protected Column deleteClusterInvalsColumn
protected List<Column> clusterInvalidationsColumns
protected Map<String,List<SQLStatement>> sqlStatements
protected Map<String,Serializable> sqlStatementsProperties
protected List<String> getBinariesSql
protected List<Column> getBinariesColumns
public Database getDatabase()
public String getSelectRootIdSql()
public Column getSelectRootIdWhatColumn()
public String getInsertRootIdSql()
public List<Column> getInsertRootIdColumns()
public SQLInfo.SQLInfoSelection getSelection(SelectionType type)
public String getSelectChildrenIdsAndTypesSql(boolean onlyComplex)
public List<Column> getSelectChildrenIdsAndTypesWhatColumns()
public String getSelectDescendantsInfoSql()
public List<Column> getSelectDescendantsInfoWhatColumns()
public String getCreateClusterNodeSql()
public List<Column> getCreateClusterNodeColumns()
public String getDeleteClusterNodeSql()
public Column getDeleteClusterNodeColumn()
public String getDeleteClusterInvalsSql()
public Column getDeleteClusterInvalsColumn()
public int getClusterNodeIdType()
public List<Column> getClusterInvalidationsColumns()
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 String getIdEqualsClause(String tableName)
Takes into account soft deletes.
tableName
- the table nametable.id = ?
public String getSoftDeleteClause(String tableName)
AND isdeleted IS NULL
if this is the hierarchy table and soft delete is activated.tableName
- the table namepublic String getSoftDeleteClause()
AND isdeleted IS NULL
if soft delete is activated.public SQLInfo.SQLInfoSelect getUpdateById(String tableName, RowMapper.RowUpdate rowu)
UPDATE tableName SET key1 = ?, key2 = ?, ... WHERE id = ? AND condition1 = ? AND condition2 IS NULL ...
public Update getUpdateByIdForKeys(String tableName, List<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 SQLInfo.SQLInfoSelect getSelectChildrenNodeInfos(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 String getSoftDeleteSql()
public String getSoftDeleteCleanupSql()
public SQLInfo.SQLInfoSelect getCopyHier(boolean explicitName, boolean resetVersion)
public String getCopySql(String tableName)
public Column getCopyIdColumn(String tableName)
protected void initSQL()
protected void initClusterSQL()
protected void initRepositorySQL()
protected void initHierarchySQL()
protected void initSelectDescendantsSQL()
protected void initAncestorsSQL()
This table holds trigger-updated information extracted from the recursive parent-child relationship in the hierarchy table.
protected void initFragmentSQL(String tableName)
protected void initSelections()
public SQLInfo.SQLInfoSelect makeSelect(Table table, String[] orderBys, String... freeColumns)
with optional ORDER BY x, y DESC
public SQLInfo.SQLInfoSelect makeSelect(Table table, String from, List<String> clauses, String[] orderBys, String... freeColumns)
public void initSQLStatements(Map<String,Serializable> testProps, List<String> sqlInitFiles) throws IOException
IOException
public void executeSQLStatements(String category, String ddlMode, Connection connection, JDBCLogger logger, SQLStatement.ListCollector ddlCollector) throws SQLException
SQLException
public int getMaximumArgsForIn()
Copyright © 2018 Nuxeo. All rights reserved.