Class DbTable
java.lang.Object
org.silverpeas.components.mydb.model.DbTable
Table loaded from the database referred by a
MyDBConnectionInfo instance.- Author:
- mmoquillon
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified row into this table.defaultTable(MyDBConnectionInfo dsInfo) Loads the default table defined in the specifiedMyDBConnectionInfoinstance.longDeletes the specified row.Gets the column with the specified name.Gets all the columns that made up this table.getName()Gets this table's name.org.silverpeas.core.util.SilverpeasList<TableRow>getRows(ColumnValuePredicate filter, String orderBy, org.silverpeas.core.admin.PaginationPage pagination) Gets the contents of this table as a list of rows, each of them being a tuple valuing all the columns of this table.list(MyDBConnectionInfo dsInfo) Gets a listing of the names of all the business tables in the database.table(String tableName, MyDBConnectionInfo dsInfo) Gets the table with the specified name from the database referenced by the given connection information.longUpdates the specified row with the specified other row.
-
Method Details
-
defaultTable
Loads the default table defined in the specifiedMyDBConnectionInfoinstance. If no default table is defined then nothing is returned. If the default table doesn't exist then aMyDBRuntimeExceptionis thrown.- Parameters:
dsInfo- theMyDBConnectionInfoinstance with information to access the database and to get the name of the table load.- Returns:
- optionally a
DbTableinstance or nothing if no default table is set in the specifiedMyDBConnectionInfoinstance.
-
table
Gets the table with the specified name from the database referenced by the given connection information. If no such a table doesn't exist, then nothing is returned.- Parameters:
tableName- the name of a table in the database.dsInfo- theMyDBConnectionInfoinstance with information to access the database- Returns:
- optionally a
DbTableinstance or nothing if no such a table exist in the database.
-
list
Gets a listing of the names of all the business tables in the database. The database is identified by the specifiedMyDBConnectionInfoinstance. (The system and technical tables aren't get.)- Parameters:
dsInfo- theMyDBConnectionInfoinstance with information to access the database.- Returns:
- a list with the name of all the business tables in the database.
-
getName
Gets this table's name.- Returns:
- the name of this table.
-
getColumns
Gets all the columns that made up this table. If no columns were specified for this table, then an empty list is returned.- Returns:
- a list of columns.
-
getColumn
Gets the column with the specified name.- Parameters:
name- the name of the column.- Returns:
- optionally the asked column. If no such column exists then an empty optional is returned.
-
getRows
public org.silverpeas.core.util.SilverpeasList<TableRow> getRows(ColumnValuePredicate filter, String orderBy, org.silverpeas.core.admin.PaginationPage pagination) Gets the contents of this table as a list of rows, each of them being a tuple valuing all the columns of this table. If the table is empty, then an empty list is returned.- Parameters:
filter- a predicate to use for filtering the table content.orderBy- an order by directive already built (without the clause keywords).pagination- a pagination in order to avoid bad performances.- Returns:
- a list of table rows. If a filter is set, it is then applied when requesting the
content of this table. The number of table rows is limited by the
MyDBConnectionInfo.getDataMaxNumber()property.
-
delete
Deletes the specified row.- Parameters:
row- the row to delete in this database table.
-
update
Updates the specified row with the specified other row.- Parameters:
actualRow- the row currently in this table.updatedRow- the row that will replace the actual one in this table.
-
add
Adds the specified row into this table. The row will be inserted into the database table.- Parameters:
row- the row to add into the database table.
-