Class DataContractManagerDB


  • public final class DataContractManagerDB
    extends Object
    Data base connection.
    • 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 ID
        dataSetID - ID of dataset
        Returns:
        The Contracts
      • close

        public void close()
        Close DB.