public final class DslQueryHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROJECTION_DSL
the projection part of DSL
|
Modifier and Type | Method and Description |
---|---|
static com.fasterxml.jackson.databind.JsonNode |
createGetByIdDSLSelectMultipleQuery(Map<String,String> projectionCriteriaMap)
Create GetById Select Multiple Query Dsl request that contains only projection.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
createMassiveUpdateDSLBaseQuery(com.fasterxml.jackson.databind.JsonNode modifiedFields) |
static com.fasterxml.jackson.databind.JsonNode |
createSearchQueryAccessionRegister(Map<String,Object> options) |
static 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"] } } ] }] |
static com.fasterxml.jackson.databind.JsonNode |
createSelectDSLQuery(Map<String,String> searchCriteriaMap) |
static com.fasterxml.jackson.databind.JsonNode |
createSelectElasticsearchDSLQuery(Map<String,Object> searchCriteriaMap) |
static com.fasterxml.jackson.databind.JsonNode |
createSingleQueryDSL(Map<String,Object> searchCriteriaMap)
generate the DSL query after receiving the search criteria
|
static com.fasterxml.jackson.databind.JsonNode |
createUpdateByIdDSLQuery(Map<String,com.fasterxml.jackson.databind.JsonNode> searchCriteriaMap,
Map<String,com.fasterxml.jackson.databind.JsonNode> updateRules) |
static UpdateMultiQuery |
getFullMetadataActionQuery(com.fasterxml.jackson.databind.JsonNode metadataModifications,
com.fasterxml.jackson.databind.node.ObjectNode fullQuery) |
public static final String PROJECTION_DSL
public static 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 static 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 static 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 static 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 static 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 static com.fasterxml.jackson.databind.node.ObjectNode createMassiveUpdateDSLBaseQuery(com.fasterxml.jackson.databind.JsonNode modifiedFields)
public static UpdateMultiQuery getFullMetadataActionQuery(com.fasterxml.jackson.databind.JsonNode metadataModifications, com.fasterxml.jackson.databind.node.ObjectNode fullQuery) throws InvalidParseOperationException, InvalidCreateOperationException
public static com.fasterxml.jackson.databind.JsonNode createSearchQueryAccessionRegister(Map<String,Object> options) throws InvalidCreateOperationException
InvalidCreateOperationException
public static com.fasterxml.jackson.databind.JsonNode createSelectAndUpdateDSLQuery(Map<String,Object> optionsMap) throws InvalidCreateOperationException
optionsMap
- input options given by frontend applicationInvalidCreateOperationException
Copyright © 2018 Vitam. All rights reserved.