Class Db2ResourceReferenceDAO
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.ResourceReferenceDAO
-
- com.ibm.fhir.persistence.jdbc.db2.Db2ResourceReferenceDAO
-
- All Implemented Interfaces:
IResourceReferenceDAO
,java.lang.AutoCloseable
public class Db2ResourceReferenceDAO extends ResourceReferenceDAO
Db2-specific extension of theResourceReferenceDAO
to work around some SQL syntax and Postgres concurrency issues
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.ResourceReferenceDAO
BATCH_SIZE
-
-
Constructor Summary
Constructors Constructor Description Db2ResourceReferenceDAO(IDatabaseTranslator t, java.sql.Connection c, java.lang.String schemaName, ICommonTokenValuesCache cache, java.lang.String adminSchemaName, INameIdCache<java.lang.Integer> parameterNameCache)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doCanonicalValuesUpsert(java.lang.String paramList, java.util.Collection<java.lang.String> sortedURLS)
Insert any missing values into the common_canonical_values tablevoid
doCodeSystemsUpsert(java.lang.String paramList, java.util.Collection<java.lang.String> sortedSystemNames)
Insert any missing values into the code_systems tableprotected void
doCommonTokenValuesUpsert(java.lang.String paramList, java.util.Collection<CommonTokenValue> sortedTokenValues)
Execute the insert (upsert) into the common_token_values table for the given collection of values.protected void
insertResourceProfiles(java.lang.String resourceType, java.util.Collection<ResourceProfileRec> profiles)
protected void
insertResourceSecurity(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert _security parameters to the resource-specific xx_SECURITY tableprotected void
insertResourceTags(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert the tags referenced by the given collection of token value recordsprotected void
insertResourceTokenRefs(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert the values in the resource-type-specific _resource_token_refs table.protected void
insertSystemResourceProfiles(java.lang.String resourceType, java.util.Collection<ResourceProfileRec> profiles)
Insert PROFILE parametersprotected void
insertSystemResourceSecurity(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert _security parametes to the whole-system LOGICAL_REOURCE_SECURITY tableprotected void
insertSystemResourceTags(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert _tag parameters to the whole-system LOGICAL_RESOURCE_TAGS tableprotected void
insertSystemResourceTokenRefs(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Insert any whole-system parameters to the token_refs tableprotected int
readOrAddParameterNameId(java.lang.String parameterName)
Fetch the id for the given parameter name from the database, creating a new entry if required.-
Methods inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.ResourceReferenceDAO
addNormalizedValues, close, doCodeSystemsFetch, flush, getCache, getConnection, getParameterNameId, getResourceReferenceCache, getSchemaName, getTranslator, persist, readCanonicalId, readCommonTokenValueId, readCommonTokenValueIdList, readCommonTokenValueIds, upsertCanonicalValues, upsertCodeSystems, upsertCommonTokenValues
-
-
-
-
Constructor Detail
-
Db2ResourceReferenceDAO
public Db2ResourceReferenceDAO(IDatabaseTranslator t, java.sql.Connection c, java.lang.String schemaName, ICommonTokenValuesCache cache, java.lang.String adminSchemaName, INameIdCache<java.lang.Integer> parameterNameCache)
Public constructor- Parameters:
t
-c
-schemaName
-cache
-
-
-
Method Detail
-
doCodeSystemsUpsert
public void doCodeSystemsUpsert(java.lang.String paramList, java.util.Collection<java.lang.String> sortedSystemNames)
Description copied from class:ResourceReferenceDAO
Insert any missing values into the code_systems table- Specified by:
doCodeSystemsUpsert
in classResourceReferenceDAO
-
doCanonicalValuesUpsert
public void doCanonicalValuesUpsert(java.lang.String paramList, java.util.Collection<java.lang.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(java.lang.String paramList, java.util.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
-
insertResourceTokenRefs
protected void insertResourceTokenRefs(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert the values in the resource-type-specific _resource_token_refs table. This is a simple batch insert because all the FKs have already been resolved and updated in the ResourceTokenValueRec records- Overrides:
insertResourceTokenRefs
in classResourceReferenceDAO
-
insertSystemResourceTokenRefs
protected void insertSystemResourceTokenRefs(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert any whole-system parameters to the token_refs table- Overrides:
insertSystemResourceTokenRefs
in classResourceReferenceDAO
-
insertResourceProfiles
protected void insertResourceProfiles(java.lang.String resourceType, java.util.Collection<ResourceProfileRec> profiles)
- Overrides:
insertResourceProfiles
in classResourceReferenceDAO
-
insertSystemResourceProfiles
protected void insertSystemResourceProfiles(java.lang.String resourceType, java.util.Collection<ResourceProfileRec> profiles)
Description copied from class:ResourceReferenceDAO
Insert PROFILE parameters- Overrides:
insertSystemResourceProfiles
in classResourceReferenceDAO
-
insertResourceTags
protected void insertResourceTags(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert the tags referenced by the given collection of token value records- Overrides:
insertResourceTags
in classResourceReferenceDAO
-
insertSystemResourceTags
protected void insertSystemResourceTags(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert _tag parameters to the whole-system LOGICAL_RESOURCE_TAGS table- Overrides:
insertSystemResourceTags
in classResourceReferenceDAO
-
insertResourceSecurity
protected void insertResourceSecurity(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert _security parameters to the resource-specific xx_SECURITY table- Overrides:
insertResourceSecurity
in classResourceReferenceDAO
-
insertSystemResourceSecurity
protected void insertSystemResourceSecurity(java.lang.String resourceType, java.util.Collection<ResourceTokenValueRec> xrefs)
Description copied from class:ResourceReferenceDAO
Insert _security parametes to the whole-system LOGICAL_REOURCE_SECURITY table- Overrides:
insertSystemResourceSecurity
in classResourceReferenceDAO
-
readOrAddParameterNameId
protected int readOrAddParameterNameId(java.lang.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
-
-