Class SelectParserSingle
java.lang.Object
fr.gouv.vitam.common.database.parser.request.AbstractParser<RequestSingle>
fr.gouv.vitam.common.database.parser.request.single.RequestParserSingle
fr.gouv.vitam.common.database.parser.request.single.SelectParserSingle
Select Parser: { $query : query, $filter : filter, $projection : projection }
-
Field Summary
Fields inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser
adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProjection
(com.fasterxml.jackson.databind.node.ObjectNode slice, com.fasterxml.jackson.databind.node.ObjectNode allFields) Add the new Projection slice to the current Projection.protected RequestSingle
void
parse
(com.fasterxml.jackson.databind.JsonNode request) void
parseQueryOnly
(String query) void
projectionParse
(com.fasterxml.jackson.databind.JsonNode rootNode) $fields : {name1 : 0/1, name2 : 0/1, ...}, $usage : contractIdMethods inherited from class fr.gouv.vitam.common.database.parser.request.single.RequestParserSingle
addCondition, analyzeRootQuery, filterParse, getLastDepth, hintCache, hintNoTimeout, model, parseJson, queryParse, toString
Methods inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser
analyzeOneCommand, getAdapter, getRootNode, getSource, hasFullTextQuery, parseOrderByFilter
-
Constructor Details
-
SelectParserSingle
public SelectParserSingle()Empty constructor -
SelectParserSingle
- Parameters:
adapter
- VarNameAdapter
-
-
Method Details
-
getNewRequest
- Specified by:
getNewRequest
in classAbstractParser<RequestSingle>
- Returns:
- a new Request
-
parse
public void parse(com.fasterxml.jackson.databind.JsonNode request) throws InvalidParseOperationException - Specified by:
parse
in classAbstractParser<RequestSingle>
- Parameters:
request
- containing a parsed JSON as { $query : query, $filter : filter, $projection : projection }- Throws:
InvalidParseOperationException
- if request could not parse to JSON
-
parseQueryOnly
- Overrides:
parseQueryOnly
in classRequestParserSingle
- Parameters:
query
- containing only the JSON request part (no filter neither projection nor roots)- Throws:
InvalidParseOperationException
- if query could not parse to projection
-
projectionParse
public void projectionParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException $fields : {name1 : 0/1, name2 : 0/1, ...}, $usage : contractId- Parameters:
rootNode
- JsonNode- Throws:
InvalidParseOperationException
- if rootNode could not parse to projection or check sanity to rootNode is in error
-
addProjection
public void addProjection(com.fasterxml.jackson.databind.node.ObjectNode slice, com.fasterxml.jackson.databind.node.ObjectNode allFields) throws InvalidParseOperationException Add the new Projection slice to the current Projection. If the existing projection is empty, the allFields is added first.- Parameters:
slice
- the projection to addallFields
- the default fields to add if none exists yet- Throws:
InvalidParseOperationException
- if slice or allFields is null or check sanity to them is in error
-
getRequest
- Overrides:
getRequest
in classAbstractParser<RequestSingle>
- Returns:
- the Request
-