Class ParameterDAOImpl
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
-
- org.linuxforhealth.fhir.persistence.jdbc.dao.impl.ParameterDAOImpl
-
- All Implemented Interfaces:
FHIRDbDAO,ParameterDAO
public class ParameterDAOImpl extends FHIRDbDAOImpl implements ParameterDAO
This Data Access Object implements the ParameterDAO interface for creating, updating, and retrieving rows in the IBM FHIR Server parameter-related tables.
-
-
Constructor Summary
Constructors Constructor Description ParameterDAOImpl(java.sql.Connection connection, java.lang.String schemaName, FHIRDbFlavor flavor)Constructs a DAO using the passed externally managed database connection.ParameterDAOImpl(java.sql.Connection connection, java.lang.String schemaName, FHIRDbFlavor flavor, javax.transaction.TransactionSynchronizationRegistry trxSynchRegistry)Constructs a DAO instance suitable for acquiring connections from a JDBC Datasource object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intacquireParameterNameId(java.lang.String parameterName)Acquire and return the id associated with the passed parameter name.java.util.Map<java.lang.String,java.lang.Integer>readAllCodeSystems()Reads all rows in the Code_Systems table and returns the data as a Mapjava.util.Map<java.lang.String,java.lang.Integer>readAllSearchParameterNames()Reads all rows in the Parameter_Names table and returns the data as a Mapjava.lang.IntegerreadCodeSystemId(java.lang.String codeSystemName)Read the id for the given code system name, but do not create a new record if it doesn't exist.intreadOrAddCodeSystemId(java.lang.String codeSystemName)Calls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table.intreadOrAddParameterNameId(java.lang.String parameterName)Calls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table.java.lang.IntegerreadParameterNameId(java.lang.String parameterName)Read the id for the given parameter name, but do not create a new record if it doesn't exist.-
Methods inherited from class org.linuxforhealth.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
buildExceptionWithIssue, buildFHIRPersistenceDBConnectException, cleanup, cleanup, createDTO, createDTOs, getConnection, getFlavor, getSchemaName, getTranslator, runCountQuery, runCountQuery, runQuery, runQuery, runQuery_STR_VALUES, severe, severe
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.persistence.jdbc.dao.api.FHIRDbDAO
getConnection, getFlavor
-
-
-
-
Constructor Detail
-
ParameterDAOImpl
public ParameterDAOImpl(java.sql.Connection connection, java.lang.String schemaName, FHIRDbFlavor flavor, javax.transaction.TransactionSynchronizationRegistry trxSynchRegistry)Constructs a DAO instance suitable for acquiring connections from a JDBC Datasource object.- Parameters:
Connection- - A database connection that will be managed by the caller.schemaName-flavor-trxSynchRegistry-
-
ParameterDAOImpl
public ParameterDAOImpl(java.sql.Connection connection, java.lang.String schemaName, FHIRDbFlavor flavor)Constructs a DAO using the passed externally managed database connection. The connection used by this instance for all DB operations will be the passed connection.- Parameters:
Connection- - A database connection that will be managed by the caller.schemaName-flavor-
-
-
Method Detail
-
readAllSearchParameterNames
public java.util.Map<java.lang.String,java.lang.Integer> readAllSearchParameterNames() throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterDAOReads all rows in the Parameter_Names table and returns the data as a Map- Specified by:
readAllSearchParameterNamesin interfaceParameterDAO- Returns:
- Map
- A map containing key=parameter-name, value=parameter-name-id - Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
-
readAllCodeSystems
public java.util.Map<java.lang.String,java.lang.Integer> readAllCodeSystems() throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterDAOReads all rows in the Code_Systems table and returns the data as a Map- Specified by:
readAllCodeSystemsin interfaceParameterDAO- Returns:
- Map
- A map containing key=system-name, value=system-id - Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
-
readOrAddParameterNameId
public int readOrAddParameterNameId(java.lang.String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionCalls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table. If it's not in the DB, it will be stored and a unique id will be returned.- Specified by:
readOrAddParameterNameIdin interfaceParameterDAO- Parameters:
parameter-- Returns:
- Integer - The generated id of the stored system.
- Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
-
readOrAddCodeSystemId
public int readOrAddCodeSystemId(java.lang.String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionCalls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table. If it's not in the DB, it will be stored and a unique id will be returned.- Specified by:
readOrAddCodeSystemIdin interfaceParameterDAO- Parameters:
parameter-- Returns:
- Integer - The generated id of the stored system.
- Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessExceptionFHIRPersistenceException
-
acquireParameterNameId
public int acquireParameterNameId(java.lang.String parameterName) throws FHIRPersistenceExceptionAcquire and return the id associated with the passed parameter name. Being called here means that we've already had a cache miss in the JDBCIdentityCache- Specified by:
acquireParameterNameIdin interfaceParameterDAO- Parameters:
parameterName- The name of a valid FHIR search parameter.- Returns:
- Integer A parameter id.
- Throws:
FHIRPersistenceException
-
readParameterNameId
public java.lang.Integer readParameterNameId(java.lang.String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterDAORead the id for the given parameter name, but do not create a new record if it doesn't exist.- Specified by:
readParameterNameIdin interfaceParameterDAO- Returns:
- the id for the parameter name, or null not found
- Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
-
readCodeSystemId
public java.lang.Integer readCodeSystemId(java.lang.String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterDAORead the id for the given code system name, but do not create a new record if it doesn't exist.- Specified by:
readCodeSystemIdin interfaceParameterDAO- Returns:
- Integer - The id associated with the passed code system name, or null if it doesn't exist
- Throws:
FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
-
-