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.ConnectiongetConnection()Provide the connection to subclassesprotected java.lang.StringgetSchemaName()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 MapintreadOrAddParameterNameId(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 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 FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterNameDAOReads all rows in the Parameter_Names table and returns the data as a Map- Specified by:
readAllSearchParameterNamesin interfaceParameterNameDAO- Returns:
- A map containing key=parameter-name, value=parameter-name-id
- Throws:
FHIRPersistenceDataAccessException
-
readOrAddParameterNameId
public int readOrAddParameterNameId(java.lang.String parameterName) throws 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 interfaceParameterNameDAO- Parameters:
parameterName-- Returns:
- The generated id of the stored system.
- Throws:
FHIRPersistenceDataAccessException
-
readParameterNameId
public java.lang.Integer readParameterNameId(java.lang.String parameterName) throws FHIRPersistenceDataAccessExceptionDescription copied from interface:ParameterNameDAORead the parameter_name_id for the given parameterName- Specified by:
readParameterNameIdin 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
-
-