Conversation
e58640e to
35f4933
Compare
1. Converted JDBC DTO Parameter into a "proper" visitor pattern. This makes adding a CompositeParameter a lot easier and generally cleans things up a bit. 2. Introduced CompositParameter which contains a list of component parameters of any type. 3. Stubbed out Composite search tests, including: * extension-search-parameters.json with a single composite search parm * BasicComposite.json with a repeating element for testing composite * AbstractSearchCompositeTest stub for laying out the test logic * JDBCSearchCompositeTest for executing the tests on Derby 4. SearchUtil and ParametersUtil updates to include SearchParameter canonical uris as an alternative key to the SearchParameter code * Also updated fhir-search tests to double the expected search parameter counts accordingly 5. Implemented initial CompositeParameter extraction logic in FHIRPersistenceJDBCImpl; needs further cleanup Next steps: * add the BASIC_COMPOSITES table * update ParamterVisitorBatchDAO (and ParameterDAOImpl?) to * update Db2 stored proc to do similar * update SearchUtil to properly parse parameters for composite search parms * update JDBCQueryBuilder to query on the Composite table Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. renamed fhir-search Parameter and ParameterValue classes to `QueryParameter` and `QueryParameterValue` respectively to disambiguate from fhir-jdbc Parameter classes 2. renamed fhir-persistence-jdbc IParameter and IParameterVisitor classes to ExtractedParameterValue and ExtractedParameterValueVisitor to further disambiguate. also renamed subtypes from XParameter to XParmVal to align with the db table names (X_Y_VALUES) 3. removed unused transformXParameters methods from ParameterDAO interface and impl 4. other miscelaneous updates Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. Introduce support for db-generated identity columns in fhir-database-utils. Instead of adding to columndefinition, I added it to Table...similar to how primaryKey was implemented. 2. Added ROW_ID columns for all X_Y_VALUES tables and set to `GENERATED BY DEFAULT` and made primary key to ensure uniqueness. 3. Created X_COMPOSITES table with foreign keys to the X_Y_VALUES ROW_IDs. Also renamed FhirResourceGroup to FhirResourceTableGroup to better reflect its purpose. 4. Added visit(CompositeParmVal) variant to ExtractedParameterValueVisitor and implemented initial DTO logic in ParameterVisitorBatchDAO; now the components are saved to the X_Y_VALUES tables and the composite row is written using their generated ROW_IDs (obtained from `preparedStatement.getGeneratedKeys()`). Also removed composite-parameters.json that I had accidentally checked in from a previous commit. Next steps: * update SearchUtil to properly parse parameters for composite search parms * update JDBCQueryBuilder to query on the Composite table * update the Db2 stored proc to work similar (possibly using 'SELECT from INSERT' as documented at https://www.ibm.com/support/knowledgecenter/en/SSEPEK_12.0.0/apsg/src/tpc/db2z_identitycols.html#d7934e239 ) Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Also updated BasicReference.json so that Reference-id has an identifier and no reference value. Previously I thought that a reference value could be just a resource id with the type prefix, but it turns out this "infer the type" behavior is only for the query and not the resource value. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
it turns out we don't pass the parameters into the stored proc any more, so the only update here was to delete the parameters from the composites when we get a new version of the resource (which covers both `delete` and `update` cases). also, i deleted the stale `addParameterArrayTypes.sql` stored procedure template, and the corresponding methods that were defining custom array types that were only used from this one procedure. finally, i added a dependency from the resource tables to the "global" search parameter values tables in fhir-persistence-schema...this to avoid a deadlock I was hitting very frequently while attempting to deploy the schema to db2 in a local container Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Technically this is an optional dependency, but including it as a runtime dependency makes it slightly more convenient to: * run the Main from eclipse / other IDEs * package the jar with "batteries included" so it can work with db2 out of the box I also added the following command to `create-database.sh` to hopefully avoid a "transaction log full" Db2 SQL Exception I hit once: * `db2 update database cfg for LOGFILSIZE using 4000` Finally, I updated some of the README documentation and delivered a sample `db2.properties` file...hopefully making it easier for others to follow. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Added info about Composite, Location, and Number/Quantity precision searches. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
I think I added this code originally when first doing the `:missing` implementation, but its not clearly labeled and I'm not sure why we'd want to keep it. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
| assertNotNull(result); | ||
| printSearchParameters("testGetApplicableSearchParameters2", result); | ||
| assertEquals(23, result.size()); | ||
| assertEquals(23 * 2, result.size()); |
Contributor
There was a problem hiding this comment.
* 2, has a particular purpose. Can we throw this in a Constant that explains it?
SearchTest.NUMBER_2_DOES_X?
Member
Author
There was a problem hiding this comment.
Because we're now indexin the list by both the code and the canonical uri, the expected size is now 2 times the number of search parameters.
I don't even love these tests which just happen to know the number of expected parameters in the file...seems like it would be better to just compute it from the file...otherwise its for sure gonna break each time we add or remove a search parameter.
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
reviewed
Dec 16, 2019
prb112
suggested changes
Dec 16, 2019
Contributor
prb112
left a comment
There was a problem hiding this comment.
LGTM, needs to be updated master (obvious as it is in progress)
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
prb112
reviewed
Dec 17, 2019
prb112
reviewed
Dec 17, 2019
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converted JDBC DTO Parameter into a "proper" visitor pattern. This
makes adding a CompositeParameter a lot easier and generally cleans
things up a bit.
Introduced CompositParameter which contains a list of component
parameters of any type.
Stubbed out Composite search tests, including:
SearchUtil and ParametersUtil updates to include SearchParameter
canonical uris as an alternative key to the SearchParameter code
parameter counts accordingly
Implemented initial CompositeParameter extraction logic in
FHIRPersistenceJDBCImpl; needs further cleanup
Introduce support for db-generated identity columns in
fhir-database-utils. Instead of adding to columndefinition, I added it
to Table...similar to how primaryKey was implemented.
Added ROW_ID columns for all X_Y_VALUES tables and set to
GENERATED BY DEFAULTand made primary key to ensure uniqueness.Created X_COMPOSITES table with foreign keys to the X_Y_VALUES
ROW_IDs. Also renamed FhirResourceGroup to FhirResourceTableGroup to
better reflect its purpose.
Added visit(CompositeParmVal) variant to
ExtractedParameterValueVisitor and implemented initial DTO logic in
ParameterVisitorBatchDAO; now the components are saved to the X_Y_VALUES
tables and the composite row is written using their generated ROW_IDs
(obtained from
preparedStatement.getGeneratedKeys())Updated SearchUtil to parse composite parameters, both for regular and chained searches
Added processComposite method to AbstractQueryBuilder and JDBCQueryBuilder:
Expanded Composite search tests (and fixed related issues):
Location)missingmodifier on composite parametersval1$val2,val1$val3)Updated Db2 stored proc to remove composite parameters. Also removed the outdated
addParameterArrayTypes.sqlstored proc and the associated array types which were still in our schema but no longer used.Addressed issue Db2 deadlock while executing com.ibm.fhir.schema.app.Main --update-schema #508 by adding a dependency from the resource tables to the global parameter value tables...now the global parameter value tables should always be added first and this should hopefully avoid the deadlock.
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com