Class DerbyResourceReferenceDAO
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.ResourceReferenceDAO
-
- com.ibm.fhir.persistence.jdbc.derby.DerbyResourceReferenceDAO
-
- All Implemented Interfaces:
IResourceReferenceDAO
,AutoCloseable
public class DerbyResourceReferenceDAO extends ResourceReferenceDAO
Derby-specific extension of theResourceReferenceDAO
to work around some SQL syntax and Derby concurrency issues
-
-
Constructor Summary
Constructors Constructor Description DerbyResourceReferenceDAO(IDatabaseTranslator t, Connection c, String schemaName, ICommonTokenValuesCache cache, INameIdCache<Integer> parameterNameCache)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doCanonicalValuesUpsert(String paramList, Collection<String> sortedURLS)
Insert any missing values into the common_canonical_values tableprotected void
doCodeSystemsFetch(Map<String,Integer> idMap, String inList, List<String> sortedSystemNames)
Fetch the code_system_id values for each of the code_system_name values in the sortedSystemNames list.void
doCodeSystemsUpsert(String paramList, Collection<String> sortedSystemNames)
Insert any missing values into the code_systems tableprotected void
doCommonTokenValuesUpsert(String paramList, Collection<CommonTokenValue> sortedTokenValues)
Execute the insert (upsert) into the common_token_values table for the given collection of values.Set<CommonTokenValueResult>
readCommonTokenValueIds(Collection<CommonTokenValue> tokenValues)
Find database ids for a set of common token valuesprotected int
readOrAddParameterNameId(String parameterName)
Fetch the id for the given parameter name from the database, creating a new entry if required.void
upsertCommonTokenValues(List<ResourceTokenValueRec> values)
Add reference value records for each unique reference name in the given list-
Methods inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.ResourceReferenceDAO
addNormalizedValues, close, flush, getCache, getConnection, getParameterNameId, getResourceReferenceCache, getSchemaName, getTranslator, insertResourceProfiles, insertResourceSecurity, insertResourceTags, insertResourceTokenRefs, insertSystemResourceProfiles, insertSystemResourceSecurity, insertSystemResourceTags, insertSystemResourceTokenRefs, persist, readCanonicalId, readCommonTokenValueId, readCommonTokenValueIdList, upsertCanonicalValues, upsertCodeSystems
-
-
-
-
Constructor Detail
-
DerbyResourceReferenceDAO
public DerbyResourceReferenceDAO(IDatabaseTranslator t, Connection c, String schemaName, ICommonTokenValuesCache cache, INameIdCache<Integer> parameterNameCache)
Public constructor- Parameters:
t
-c
-schemaName
-cache
-
-
-
Method Detail
-
readCommonTokenValueIds
public Set<CommonTokenValueResult> readCommonTokenValueIds(Collection<CommonTokenValue> tokenValues)
Description copied from interface:IResourceReferenceDAO
Find database ids for a set of common token values- Specified by:
readCommonTokenValueIds
in interfaceIResourceReferenceDAO
- Overrides:
readCommonTokenValueIds
in classResourceReferenceDAO
- Returns:
- a non-null, possibly-empty set of ids from common_token_values.common_token_value_id; CommonTokenValues with no corresponding record will be omitted from the set
-
doCodeSystemsUpsert
public void doCodeSystemsUpsert(String paramList, Collection<String> sortedSystemNames)
Description copied from class:ResourceReferenceDAO
Insert any missing values into the code_systems table- Specified by:
doCodeSystemsUpsert
in classResourceReferenceDAO
-
doCodeSystemsFetch
protected void doCodeSystemsFetch(Map<String,Integer> idMap, String inList, List<String> sortedSystemNames)
Description copied from class:ResourceReferenceDAO
Fetch the code_system_id values for each of the code_system_name values in the sortedSystemNames list.- Overrides:
doCodeSystemsFetch
in classResourceReferenceDAO
- Parameters:
idMap
- the code_system_name -> code_system_id map to populateinList
- a list of bind markers for the values in the sortedSystemNames listsortedSystemNames
- the list of code_system_name values to fetch
-
doCanonicalValuesUpsert
public void doCanonicalValuesUpsert(String paramList, Collection<String> sortedURLS)
Description copied from class:ResourceReferenceDAO
Insert any missing values into the common_canonical_values table- Specified by:
doCanonicalValuesUpsert
in classResourceReferenceDAO
-
doCommonTokenValuesUpsert
protected void doCommonTokenValuesUpsert(String paramList, Collection<CommonTokenValue> sortedTokenValues)
Description copied from class:ResourceReferenceDAO
Execute the insert (upsert) into the common_token_values table for the given collection of values. Note, this insert from negative outer join requires the database concurrency implementation to be correct. This does not work for Postgres, hence Postgres gets its own implementation of this method- Specified by:
doCommonTokenValuesUpsert
in classResourceReferenceDAO
-
upsertCommonTokenValues
public void upsertCommonTokenValues(List<ResourceTokenValueRec> values)
Description copied from class:ResourceReferenceDAO
Add reference value records for each unique reference name in the given list- Overrides:
upsertCommonTokenValues
in classResourceReferenceDAO
-
readOrAddParameterNameId
protected int readOrAddParameterNameId(String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from class:ResourceReferenceDAO
Fetch the id for the given parameter name from the database, creating a new entry if required.- Specified by:
readOrAddParameterNameId
in classResourceReferenceDAO
- Returns:
- Throws:
FHIRPersistenceDBConnectException
FHIRPersistenceDataAccessException
-
-