Class ParameterNameDAOImpl
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.ParameterNameDAOImpl
-
- All Implemented Interfaces:
ParameterNameDAO
- Direct Known Subclasses:
DerbyParameterNamesDAO
,PostgreSqlParameterNamesDAO
public class ParameterNameDAOImpl extends Object implements ParameterNameDAO
Database interaction for parameter_names. Caching etc is handled elsewhere...we're just doing JDBC stuff here.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_TOKEN_SYSTEM
-
Constructor Summary
Constructors Constructor Description ParameterNameDAOImpl(Connection connection, String schemaName)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Connection
getConnection()
Provide the connection to subclassesprotected String
getSchemaName()
Get the name of the FHIR data schema we are usingMap<String,Integer>
readAllSearchParameterNames()
Reads all rows in the Parameter_Names table and returns the data as a Mapint
readOrAddParameterNameId(String parameterName)
Calls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table.Integer
readParameterNameId(String parameterName)
Read the parameter_name_id for the given parameterName
-
-
-
Field Detail
-
DEFAULT_TOKEN_SYSTEM
public static final String DEFAULT_TOKEN_SYSTEM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParameterNameDAOImpl
public ParameterNameDAOImpl(Connection connection, String schemaName)
Public constructor
-
-
Method Detail
-
getConnection
protected Connection getConnection()
Provide the connection to subclasses- Returns:
-
getSchemaName
protected String getSchemaName()
Get the name of the FHIR data schema we are using- Returns:
-
readAllSearchParameterNames
public Map<String,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(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 Integer readParameterNameId(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
-
-