Class DataContractManagerDB
- java.lang.Object
-
- es.bsc.dataclay.logic.datacontractmgr.DataContractManagerDB
-
public final class DataContractManagerDB extends Object
Data base connection.
-
-
Constructor Summary
Constructors Constructor Description DataContractManagerDB(SQLiteDataSource dataSource)
MetaDataServiceDB constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close DB.void
createTables()
Create tables of MDS.void
deleteDataContractByID(ContractID datacontractID)
Delete by IDvoid
dropTables()
Delete the tables of MDS.List<DataContract>
getContractsWithApplicantAndDataSet(AccountID applicantAccountID, DataSetID dataSetID)
Get datacontracts containing applicant and data setDataContract
getDataContractByID(DataContractID datacontractID)
Get by IDList<DataContract>
getDataContractsOfDataSet(DataSetID dataSetID)
Get contracts of datasetList<DataContract>
getDataContractsWithApplicant(AccountID applicantAccountID)
Get data contracts containing applicantList<DataContract>
getDataContractsWithProvider(AccountID providerAccountID)
Get datacontracts containing providervoid
store(DataContract datacontract)
Store datacontract into databasevoid
updateDataContractsAddApplicant(DataContractID datacontractID, AccountID applicantAccountID)
Update by ID
-
-
-
Constructor Detail
-
DataContractManagerDB
public DataContractManagerDB(SQLiteDataSource dataSource)
MetaDataServiceDB constructor.- Parameters:
dataSource
- Name of the LM service managing.
-
-
Method Detail
-
createTables
public void createTables()
Create tables of MDS.
-
dropTables
public void dropTables()
Delete the tables of MDS. Just the other way around of createTables --much simpler.
-
store
public void store(DataContract datacontract)
Store datacontract into database- Parameters:
datacontract
- datacontract
-
getDataContractByID
public DataContract getDataContractByID(DataContractID datacontractID)
Get by ID- Parameters:
datacontractID
- ID of object- Returns:
- The object
- Throws:
SQLException
- if not found
-
deleteDataContractByID
public void deleteDataContractByID(ContractID datacontractID)
Delete by ID- Parameters:
datacontractID
- ID of object
-
updateDataContractsAddApplicant
public void updateDataContractsAddApplicant(DataContractID datacontractID, AccountID applicantAccountID)
Update by ID- Parameters:
datacontractID
- ID of object
-
getDataContractsOfDataSet
public List<DataContract> getDataContractsOfDataSet(DataSetID dataSetID)
Get contracts of dataset- Parameters:
dataSetID
- DataSet id- Returns:
- The DataContracts
-
getDataContractsWithApplicant
public List<DataContract> getDataContractsWithApplicant(AccountID applicantAccountID)
Get data contracts containing applicant- Parameters:
applicantAccountID
- Account ID- Returns:
- The Contracts
-
getDataContractsWithProvider
public List<DataContract> getDataContractsWithProvider(AccountID providerAccountID)
Get datacontracts containing provider- Parameters:
providerAccountID
- Account ID- Returns:
- The Contracts
-
getContractsWithApplicantAndDataSet
public List<DataContract> getContractsWithApplicantAndDataSet(AccountID applicantAccountID, DataSetID dataSetID)
Get datacontracts containing applicant and data set- Parameters:
applicantAccountID
- Account IDdataSetID
- ID of dataset- Returns:
- The Contracts
-
close
public void close()
Close DB.
-
-