Class ParameterNameDAOImpl
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.params.database.ParameterNameDAOImpl
-
- All Implemented Interfaces:
ParameterNameDAO
- Direct Known Subclasses:
DerbyParameterNamesDAO
,PostgresParameterNamesDAO
public class ParameterNameDAOImpl extends java.lang.Object implements ParameterNameDAO
Database interaction for parameter_names. Caching etc is handled elsewhere...we're just doing JDBC stuff here.
-
-
Constructor Summary
Constructors Constructor Description ParameterNameDAOImpl(java.sql.Connection connection, java.lang.String schemaName)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.sql.Connection
getConnection()
Provide the connection to subclassesprotected java.lang.String
getSchemaName()
Get the name of the FHIR data schema we are usingjava.util.Map<java.lang.String,java.lang.Integer>
readAllSearchParameterNames()
Reads all rows in the Parameter_Names table and returns the data as a Mapint
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 parameter_name_id for the given parameterName
-
-
-
Method Detail
-
getConnection
protected java.sql.Connection getConnection()
Provide the connection to subclasses- Returns:
-
getSchemaName
protected java.lang.String getSchemaName()
Get the name of the FHIR data schema we are using- Returns:
-
readAllSearchParameterNames
public java.util.Map<java.lang.String,java.lang.Integer> readAllSearchParameterNames() throws FHIRPersistenceDataAccessException
Description copied from interface:ParameterNameDAO
Reads all rows in the Parameter_Names table and returns the data as a Map- Specified by:
readAllSearchParameterNames
in interfaceParameterNameDAO
- Returns:
- A map containing key=parameter-name, value=parameter-name-id
- Throws:
FHIRPersistenceDataAccessException
-
readOrAddParameterNameId
public int readOrAddParameterNameId(java.lang.String parameterName) throws 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 interfaceParameterNameDAO
- Parameters:
parameterName
-- Returns:
- The generated id of the stored system.
- Throws:
FHIRPersistenceDataAccessException
-
readParameterNameId
public java.lang.Integer readParameterNameId(java.lang.String parameterName) throws FHIRPersistenceDataAccessException
Description copied from interface:ParameterNameDAO
Read the parameter_name_id for the given parameterName- Specified by:
readParameterNameId
in interfaceParameterNameDAO
- Parameters:
parameterName
- A valid FHIR search parameter name.- Returns:
- the parameter_name_id for for parameter, or null if it doesn't exist
- Throws:
FHIRPersistenceDataAccessException
-
-