Class ParameterVisitorBatchDAO
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.ParameterVisitorBatchDAO
-
- All Implemented Interfaces:
ExtractedParameterValueVisitor,AutoCloseable
public class ParameterVisitorBatchDAO extends Object implements ExtractedParameterValueVisitor, AutoCloseable
Batch insert into the parameter values tables. Avoids having to create one stored procedure per resource type, because the row type array approach apparently won't work with dynamic SQL (EXECUTE ... USING ...). Unfortunately this means we have more database round-trips, we don't have a choice.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intcompositeIdCounter(package private) IntegercurrentCompositeId(package private) StringcurrentCompositeParameterName
-
Constructor Summary
Constructors Constructor Description ParameterVisitorBatchDAO(Connection c, String adminSchemaName, String tablePrefix, boolean multitenant, long logicalResourceId, int batchSize, JDBCIdentityCache identityCache, IResourceReferenceDAO resourceReferenceDAO, ParameterTransactionDataImpl ptdi)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected intgetCodeSystemId(String codeSystem)Looks up the code system.protected intgetParameterNameId(String parameterName)Look up the normalized id for the parameter, adding it to the parameter_names table if it doesn't yet existvoidvisit(CompositeParmVal compositeParameter)Process a composite parameter valuevoidvisit(DateParmVal param)Process a date parameter valuevoidvisit(LocationParmVal param)Process a location parameter valuevoidvisit(NumberParmVal param)Process a number parameter valuevoidvisit(QuantityParmVal param)Process a quantity parameter valuevoidvisit(ReferenceParmVal rpv)Process a reference parameter valuevoidvisit(StringParmVal param)Process a string parameter valuevoidvisit(TokenParmVal param)Process a token parameter value
-
-
-
Constructor Detail
-
ParameterVisitorBatchDAO
public ParameterVisitorBatchDAO(Connection c, String adminSchemaName, String tablePrefix, boolean multitenant, long logicalResourceId, int batchSize, JDBCIdentityCache identityCache, IResourceReferenceDAO resourceReferenceDAO, ParameterTransactionDataImpl ptdi) throws SQLException
Public constructor- Parameters:
c-resourceId-- Throws:
SQLException
-
-
Method Detail
-
getParameterNameId
protected int getParameterNameId(String parameterName) throws FHIRPersistenceException
Look up the normalized id for the parameter, adding it to the parameter_names table if it doesn't yet exist- Parameters:
parameterName-- Returns:
- Throws:
FHIRPersistenceException
-
getCodeSystemId
protected int getCodeSystemId(String codeSystem) throws FHIRPersistenceException
Looks up the code system. If it doesn't exist, adds it to the database- Parameters:
codeSystem-- Returns:
- Throws:
FHIRPersistenceException
-
visit
public void visit(StringParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a string parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(NumberParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a number parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(DateParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a date parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(TokenParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a token parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(QuantityParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a quantity parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(LocationParmVal param) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a location parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
visit
public void visit(CompositeParmVal compositeParameter) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a composite parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
visit
public void visit(ReferenceParmVal rpv) throws FHIRPersistenceException
Description copied from interface:ExtractedParameterValueVisitorProcess a reference parameter value- Specified by:
visitin interfaceExtractedParameterValueVisitor- Throws:
FHIRPersistenceException
-
-