|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.storage.sql.jdbc.SQLInfo
public class SQLInfo
This singleton generates and holds the actual SQL DDL and DML statements for
the operations needed by the Mapper
, given a Model
.
It is specific to one SQL dialect.
Nested Class Summary | |
---|---|
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
|
Field Summary | |
---|---|
Database |
database
|
Dialect |
dialect
|
Constructor Summary | |
---|---|
SQLInfo(Model model,
Dialect dialect)
Generates and holds the needed SQL statements given a Model and a
Dialect . |
Method Summary | |
---|---|
void |
executeSQLStatements(String category,
JDBCConnection jdbc)
Executes the SQL statements for the given category. |
List<Column> |
getClusterInvalidationsColumns()
|
List<Column> |
getCopyHierColumns(boolean explicitName,
boolean createVersion)
|
String |
getCopyHierSql(boolean explicitName,
boolean createVersion)
|
Column |
getCopyHierWhereColumn()
|
Column |
getCopyIdColumn(String tableName)
|
String |
getCopySql(String tableName)
|
Database |
getDatabase()
|
String |
getDeleteSql(String tableName)
Returns the SQL DELETE to delete a row. |
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()
|
String |
getSelectByChildNameSql(Boolean complexProp)
|
List<Column> |
getSelectByChildNameWhatColumns(Boolean complexProp)
|
List<Column> |
getSelectByChildNameWhereColumns(Boolean complexProp)
|
String |
getSelectChildrenIdsAndTypesSql(boolean onlyComplex)
|
List<Column> |
getSelectChildrenIdsAndTypesWhatColumns()
|
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). |
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)
|
SQLInfo.SQLInfoSelect |
makeJoinSelect(Table table,
String[] freeColumns,
Table joinTable,
String[] joinCriteria)
Joining SELECT T.x, T.y, T.z FROM T, U WHERE T.id = U.id AND T.a = ? and U.b = ? |
SQLInfo.SQLInfoSelect |
makeJoinSelect(Table table,
String[] freeColumns,
Table joinTable,
String[] joinCriteria,
String[] orderBys)
Joining SELECT T.x, T.y, T.z FROM T, U WHERE T.id = U.id AND T.a = ? and U.b = ? ORDER BY x, y DESC |
SQLInfo.SQLInfoSelect |
makeSelect(Table table,
String... freeColumns)
Basic SELECT x, y, z FROM table WHERE a = ? AND b = ? |
SQLInfo.SQLInfoSelect |
makeSelect(Table table,
String[] orderBys,
String... freeColumns)
Basic SELECT with optional ORDER BY x, y DESC |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Database database
public final Dialect dialect
Constructor Detail |
---|
public SQLInfo(Model model, Dialect dialect) throws StorageException
Model
and a
Dialect
.
model
- the modeldialect
- the SQL dialect
StorageException
Method Detail |
---|
public Database getDatabase()
public String getSelectRootIdSql()
public Column getSelectRootIdWhatColumn()
public String getInsertRootIdSql()
public List<Column> getInsertRootIdColumns()
public String getSelectByChildNameSql(Boolean complexProp)
public List<Column> getSelectByChildNameWhatColumns(Boolean complexProp)
public List<Column> getSelectByChildNameWhereColumns(Boolean complexProp)
public String getSelectChildrenIdsAndTypesSql(boolean onlyComplex)
public List<Column> getSelectChildrenIdsAndTypesWhatColumns()
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 name
INSERT
statementpublic List<Column> getInsertColumns(String tableName)
getInsertSql(java.lang.String)
.
tableName
- the table name
public SQLInfo.SQLInfoSelect getUpdateById(String tableName, Collection<String> keys)
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 String getDeleteSql(String tableName)
DELETE
to delete a row. The primary key columns
are free parameters.
tableName
- the table name
INSERT
statementpublic String getCopyHierSql(boolean explicitName, boolean createVersion)
public List<Column> getCopyHierColumns(boolean explicitName, boolean createVersion)
public Column getCopyHierWhereColumn()
public String getCopySql(String tableName)
public Column getCopyIdColumn(String tableName)
public SQLInfo.SQLInfoSelect makeSelect(Table table, String... freeColumns)
public SQLInfo.SQLInfoSelect makeSelect(Table table, String[] orderBys, String... freeColumns)
public SQLInfo.SQLInfoSelect makeJoinSelect(Table table, String[] freeColumns, Table joinTable, String[] joinCriteria)
public SQLInfo.SQLInfoSelect makeJoinSelect(Table table, String[] freeColumns, Table joinTable, String[] joinCriteria, String[] orderBys)
public void initSQLStatements(Map<String,Serializable> testProps) throws IOException
IOException
public void executeSQLStatements(String category, JDBCConnection jdbc) throws SQLException
SQLException
public int getMaximumArgsForIn()
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |