public class DslQueryHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROJECTION_DSL
the projection part of DSL
|
Constructor and Description |
---|
DslQueryHelper() |
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.JsonNode |
createGetByIdDSLSelectMultipleQuery(Map<String,String> projectionCriteriaMap)
Create GetById Select Multiple Query Dsl request that contains only projection.
|
com.fasterxml.jackson.databind.node.ObjectNode |
createMassiveUpdateDSLBaseQuery(com.fasterxml.jackson.databind.JsonNode modifiedFields) |
com.fasterxml.jackson.databind.JsonNode |
createSearchQueryAccessionRegister(Map<String,Object> options) |
com.fasterxml.jackson.databind.JsonNode |
createSelectAndUpdateDSLQuery(Map<String,Object> optionsMap)
Create a JsonNode similar to a composed Select/Update DSL query
Input: {parentId: 'id', childId: 'id', action: 'ADD'} (action can be DELETE) Output: [{ "$query": [ { "$eq": { "#id": "childId" } } ], "$action": [ { "$add": { (action can be $pull if input ask for DELETE) "#up": ["parentId"] } } ] }] |
com.fasterxml.jackson.databind.JsonNode |
createSelectDSLQuery(Map<String,String> searchCriteriaMap) |
com.fasterxml.jackson.databind.JsonNode |
createSelectElasticsearchDSLQuery(Map<String,Object> searchCriteriaMap) |
com.fasterxml.jackson.databind.JsonNode |
createSingleQueryDSL(Map<String,Object> searchCriteriaMap)
generate the DSL query after receiving the search criteria
|
com.fasterxml.jackson.databind.JsonNode |
createUpdateByIdDSLQuery(Map<String,com.fasterxml.jackson.databind.JsonNode> searchCriteriaMap,
Map<String,com.fasterxml.jackson.databind.JsonNode> updateRules) |
UpdateMultiQuery |
getFullMetadataActionQuery(com.fasterxml.jackson.databind.JsonNode metadataModifications,
com.fasterxml.jackson.databind.node.ObjectNode fullQuery) |
static DslQueryHelper |
getInstance() |
public static final String PROJECTION_DSL
public static DslQueryHelper getInstance()
public com.fasterxml.jackson.databind.JsonNode createSingleQueryDSL(Map<String,Object> searchCriteriaMap) throws InvalidParseOperationException, InvalidCreateOperationException
searchCriteriaMap
- the map containing the criteriaInvalidParseOperationException
- if a parse exception is encounteredInvalidCreateOperationException
- if an Invalid create operation is encounteredpublic com.fasterxml.jackson.databind.JsonNode createSelectDSLQuery(Map<String,String> searchCriteriaMap) throws InvalidParseOperationException, InvalidCreateOperationException
searchCriteriaMap
- Criteria received from The IHM screen Empty Keys or Value is not allowedInvalidParseOperationException
- thrown when an error occurred during parsingInvalidCreateOperationException
- thrown when an error occurred during creationpublic com.fasterxml.jackson.databind.JsonNode createGetByIdDSLSelectMultipleQuery(Map<String,String> projectionCriteriaMap) throws InvalidParseOperationException, InvalidCreateOperationException
projectionCriteriaMap
- the given projection parametersInvalidParseOperationException
- null key or value parametersInvalidCreateOperationException
- queryDsl create operationpublic com.fasterxml.jackson.databind.JsonNode createSelectElasticsearchDSLQuery(Map<String,Object> searchCriteriaMap) throws InvalidParseOperationException, InvalidCreateOperationException
searchCriteriaMap
- Criteria received from The IHM screen Empty Keys or Value is not allowedInvalidParseOperationException
- thrown when an error occurred during parsingInvalidCreateOperationException
- thrown when an error occurred during creationpublic com.fasterxml.jackson.databind.JsonNode createUpdateByIdDSLQuery(Map<String,com.fasterxml.jackson.databind.JsonNode> searchCriteriaMap, Map<String,com.fasterxml.jackson.databind.JsonNode> updateRules) throws InvalidParseOperationException, InvalidCreateOperationException
searchCriteriaMap
- Criteria received from The IHM screen Empty Keys or Value is not allowedupdateRules
- rules that must be updated in the AU.InvalidParseOperationException
- thrown when an error occurred during parsingInvalidCreateOperationException
- thrown when an error occurred during creationpublic com.fasterxml.jackson.databind.node.ObjectNode createMassiveUpdateDSLBaseQuery(com.fasterxml.jackson.databind.JsonNode modifiedFields)
public UpdateMultiQuery getFullMetadataActionQuery(com.fasterxml.jackson.databind.JsonNode metadataModifications, com.fasterxml.jackson.databind.node.ObjectNode fullQuery) throws InvalidParseOperationException, InvalidCreateOperationException
public com.fasterxml.jackson.databind.JsonNode createSearchQueryAccessionRegister(Map<String,Object> options) throws InvalidCreateOperationException
InvalidCreateOperationException
public com.fasterxml.jackson.databind.JsonNode createSelectAndUpdateDSLQuery(Map<String,Object> optionsMap)
optionsMap
- input options given by frontend applicationCopyright © 2019 Vitam. All rights reserved.