app context loads

This commit is contained in:
Ken Stevens 2020-01-23 15:48:25 -05:00
parent ab74e66870
commit d2ef5555fe
10 changed files with 70 additions and 30 deletions

View File

@ -13,6 +13,8 @@ import ca.uhn.fhir.rest.param.QuantityParam;
import ca.uhn.fhir.rest.param.SpecialParam;
import ca.uhn.fhir.rest.param.TokenParam;
import org.hibernate.search.spatial.impl.Point;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.From;
@ -24,6 +26,8 @@ import java.util.List;
import static org.apache.commons.lang3.StringUtils.isBlank;
@Component
@Scope("prototype")
public class PredicateBuilderCoords extends BasePredicateBuilder {
PredicateBuilderCoords(SearchBuilder theSearchBuilder) {

View File

@ -10,6 +10,8 @@ import ca.uhn.fhir.rest.param.ParamPrefixEnum;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.From;
@ -19,6 +21,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
@Scope("prototype")
public class PredicateBuilderDate extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderDate.class);

View File

@ -8,6 +8,8 @@ import ca.uhn.fhir.rest.param.NumberParam;
import ca.uhn.fhir.rest.param.ParamPrefixEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.*;
import java.math.BigDecimal;
@ -16,7 +18,9 @@ import java.util.List;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
public class PredicateBuilderNumber extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderNumber extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderNumber.class);
PredicateBuilderNumber(SearchBuilder theSearchBuilder) {

View File

@ -8,6 +8,8 @@ import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.base.composite.BaseQuantityDt;
import ca.uhn.fhir.rest.param.ParamPrefixEnum;
import ca.uhn.fhir.rest.param.QuantityParam;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.*;
import java.math.BigDecimal;
@ -17,16 +19,18 @@ import java.util.List;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.apache.commons.lang3.StringUtils.isBlank;
public class PredicateBuilderQuantity extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderQuantity extends BasePredicateBuilder {
PredicateBuilderQuantity(SearchBuilder theSearchBuilder) {
super(theSearchBuilder);
}
public Predicate addPredicateQuantity(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Predicate addPredicateQuantity(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Join<ResourceTable, ResourceIndexedSearchParamQuantity> join = createJoin(SearchBuilderJoinEnum.QUANTITY, theParamName);
if (theList.get(0).getMissing() != null) {

View File

@ -28,6 +28,8 @@ import org.hl7.fhir.instance.model.api.IIdType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.*;
import java.util.*;
@ -35,7 +37,9 @@ import java.util.*;
import static org.apache.commons.lang3.StringUtils.*;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class PredicateBuilderReference extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderReference extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderReference.class);
@Autowired
@ -55,11 +59,11 @@ public class PredicateBuilderReference extends BasePredicateBuilder {
/**
* Add reference predicate to the current search
*/
public Predicate addPredicateReference(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation,
RequestDetails theRequest) {
Predicate addPredicateReference(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation,
RequestDetails theRequest) {
assert theParamName.contains(".") == false;

View File

@ -11,6 +11,8 @@ import org.hl7.fhir.r4.model.IdType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.annotation.Nullable;
import javax.persistence.criteria.Predicate;
@ -23,7 +25,9 @@ import java.util.Set;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class PredicateBuilderResourceId extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderResourceId extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderResourceId.class);
@Autowired

View File

@ -10,6 +10,8 @@ import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.From;
@ -18,16 +20,18 @@ import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
public class PredicateBuilderString extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderString extends BasePredicateBuilder {
PredicateBuilderString(SearchBuilder theSearchBuilder) {
super(theSearchBuilder);
}
public Predicate addPredicateString(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Predicate addPredicateString(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Join<ResourceTable, ResourceIndexedSearchParamString> join = createJoin(SearchBuilderJoinEnum.STRING, theParamName);

View File

@ -18,20 +18,24 @@ import com.google.common.collect.Lists;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.*;
import java.util.List;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class PredicateBuilderTag extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderTag extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderTag.class);
PredicateBuilderTag(SearchBuilder theSearchBuilder) {
super(theSearchBuilder);
}
public void addPredicateTag(List<List<IQueryParameterType>> theList, String theParamName) {
void addPredicateTag(List<List<IQueryParameterType>> theList, String theParamName) {
TagTypeEnum tagType;
if (Constants.PARAM_TAG.equals(theParamName)) {
tagType = TagTypeEnum.TAG;

View File

@ -19,6 +19,8 @@ import com.google.common.collect.Sets;
import org.hibernate.query.criteria.internal.CriteriaBuilderImpl;
import org.hibernate.query.criteria.internal.predicate.BooleanStaticAssertionPredicate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.*;
import java.util.*;
@ -27,7 +29,9 @@ import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.*;
import static org.apache.commons.lang3.StringUtils.isBlank;
public class PredicateBuilderToken extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderToken extends BasePredicateBuilder {
@Autowired
private ITermReadSvc myTerminologySvc;
@Autowired
@ -39,10 +43,10 @@ public class PredicateBuilderToken extends BasePredicateBuilder {
myPredicateBuilder = theSearchBuilder.getPredicateBuilder();
}
public Predicate addPredicateToken(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Predicate addPredicateToken(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
if (theList.get(0).getMissing() != null) {
Join<ResourceTable, ResourceIndexedSearchParamToken> join = createJoin(SearchBuilderJoinEnum.TOKEN, theParamName);

View File

@ -11,6 +11,8 @@ import ca.uhn.fhir.rest.param.UriParamQualifierEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.Predicate;
@ -18,7 +20,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class PredicateBuilderUri extends BasePredicateBuilder {
@Component
@Scope("prototype")
class PredicateBuilderUri extends BasePredicateBuilder {
private static final Logger ourLog = LoggerFactory.getLogger(PredicateBuilderUri.class);
@Autowired
private IResourceIndexedSearchParamUriDao myResourceIndexedSearchParamUriDao;
@ -27,10 +31,10 @@ public class PredicateBuilderUri extends BasePredicateBuilder {
super(theSearchBuilder);
}
public Predicate addPredicateUri(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Predicate addPredicateUri(String theResourceName,
String theParamName,
List<? extends IQueryParameterType> theList,
SearchFilterParser.CompareOperation operation) {
Join<ResourceTable, ResourceIndexedSearchParamUri> join = createJoin(SearchBuilderJoinEnum.URI, theParamName);