-
- Type Parameters:
T
- the type of report to handle
- All Superinterfaces:
DatabaseConnectionProvider
,DatabaseConnectionUser
,ReportProvider<T,String>
- All Known Implementing Classes:
ReportTableByID
public interface ReportProviderByID<T extends Report> extends ReportProvider<T,String>
Interface for table classes that handle the reports of a project.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
AbstractIndexedTable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
exists(String id)
Checks whether the report exists in the database.List<Integer>
getDBIDs(AbstractConditions conditions)
Return a list of database IDs of data containers that match the defined conditions.List<String>
getIDs(AbstractConditions conditions)
Return a list (Vector) of IDs of data containers that match the defined conditions.List<String>
getIDs(String[] columns, AbstractConditions conditions)
Return a list (Vector) of columns of data containers that match the defined conditions.T
load(String id)
Loads the report from the database.boolean
remove(String id)
Removes the report from the database.boolean
remove(String id, AbstractField field)
Removes the report field from the database.boolean
store(String id, T report)
Stores the report.boolean
store(String id, T report, boolean removeExisting, boolean merge, Field[] overwrite)
Stores the report.-
Methods inherited from interface adams.db.DatabaseConnectionProvider
getDatabaseConnection
-
-
-
-
Method Detail
-
store
boolean store(String id, T report)
Stores the report. Removes a previously existing report.- Specified by:
store
in interfaceReportProvider<T extends Report,String>
- Parameters:
id
- the id of the reportreport
- the report- Returns:
- true if successfully inserted/updated
-
store
boolean store(String id, T report, boolean removeExisting, boolean merge, Field[] overwrite)
Stores the report. Either updates or inserts the fields.- Specified by:
store
in interfaceReportProvider<T extends Report,String>
- Parameters:
id
- the id of the reportreport
- the reportremoveExisting
- whether to remove existing an already existing report before storing it (has precedence over "merge")merge
- whether to merge the existing and the currentoverwrite
- fields to overwrite if in "merge" mode- Returns:
- true if successfully inserted/updated
-
load
T load(String id)
Loads the report from the database.- Specified by:
load
in interfaceReportProvider<T extends Report,String>
- Parameters:
id
- the ID of parent data container- Returns:
- the report
-
exists
boolean exists(String id)
Checks whether the report exists in the database.- Specified by:
exists
in interfaceReportProvider<T extends Report,String>
- Parameters:
id
- the ID of parent data container- Returns:
- true if the report exists
-
remove
boolean remove(String id)
Removes the report from the database.- Specified by:
remove
in interfaceReportProvider<T extends Report,String>
- Parameters:
id
- the ID of the parent data container- Returns:
- true if successfully removed
-
remove
boolean remove(String id, AbstractField field)
Removes the report field from the database.- Parameters:
id
- the ID of the parent data containerfield
- the field to remove- Returns:
- true if successfully removed
-
getIDs
List<String> getIDs(AbstractConditions conditions)
Return a list (Vector) of IDs of data containers that match the defined conditions.- Specified by:
getIDs
in interfaceReportProvider<T extends Report,String>
- Parameters:
conditions
- the conditions that the conatiners must meet- Returns:
- list of container IDs
-
getIDs
List<String> getIDs(String[] columns, AbstractConditions conditions)
Return a list (Vector) of columns of data containers that match the defined conditions.- Specified by:
getIDs
in interfaceReportProvider<T extends Report,String>
- Parameters:
columns
- the columns to retrieve.conditions
- the conditions that the containers must meet- Returns:
- list of columns (tab-separated)
-
getDBIDs
List<Integer> getDBIDs(AbstractConditions conditions)
Return a list of database IDs of data containers that match the defined conditions.- Specified by:
getDBIDs
in interfaceReportProvider<T extends Report,String>
- Parameters:
conditions
- the conditions that the conatiners must meet- Returns:
- list of database IDs
-
-