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 int
acquireParameterNameId(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.Integer
readCodeSystemId(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.int
readOrAddCodeSystemId(java.lang.String codeSystemName)
Calls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table.int
readOrAddParameterNameId(java.lang.String parameterName)
Calls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table.java.lang.Integer
readParameterNameId(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, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAO
Reads all rows in the Parameter_Names table and returns the data as a Map- Specified by:
readAllSearchParameterNames
in interfaceParameterDAO
- Returns:
- Map
- A map containing key=parameter-name, value=parameter-name-id - Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
readAllCodeSystems
public java.util.Map<java.lang.String,java.lang.Integer> readAllCodeSystems() throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAO
Reads all rows in the Code_Systems table and returns the data as a Map- Specified by:
readAllCodeSystems
in interfaceParameterDAO
- Returns:
- Map
- A map containing key=system-name, value=system-id - Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
readOrAddParameterNameId
public int readOrAddParameterNameId(java.lang.String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Calls 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:
readOrAddParameterNameId
in interfaceParameterDAO
- Parameters:
parameter
-- Returns:
- Integer - The generated id of the stored system.
- Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
readOrAddCodeSystemId
public int readOrAddCodeSystemId(java.lang.String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Calls 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:
readOrAddCodeSystemId
in interfaceParameterDAO
- Parameters:
parameter
-- Returns:
- Integer - The generated id of the stored system.
- Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
FHIRPersistenceException
-
acquireParameterNameId
public int acquireParameterNameId(java.lang.String parameterName) throws FHIRPersistenceException
Acquire 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:
acquireParameterNameId
in 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, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAO
Read the id for the given parameter name, but do not create a new record if it doesn't exist.- Specified by:
readParameterNameId
in interfaceParameterDAO
- Returns:
- the id for the parameter name, or null not found
- Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
readCodeSystemId
public java.lang.Integer readCodeSystemId(java.lang.String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAO
Read the id for the given code system name, but do not create a new record if it doesn't exist.- Specified by:
readCodeSystemId
in interfaceParameterDAO
- Returns:
- Integer - The id associated with the passed code system name, or null if it doesn't exist
- Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
-