-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
InsertQuery.InsertQueryProvider
A provider toInsertQuery
, this provider converts text intoInsertQuery
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Condition>
getConditions()
The list of changes as conditions.String
getEntity()
The entity namestatic InsertQuery.InsertQueryProvider
getProvider()
Returns theInsertQuery.InsertQueryProvider
instanceOptional<Duration>
getTtl()
This duration set a time for data in an entity to expire.Optional<JSONQueryValue>
getValue()
Returns the value to insert when the query uses JSON value instead of Conditions.static InsertQuery
parse(String query)
Obtains an instance ofInsertQuery.InsertQueryProvider
from a text string.
-
-
-
Method Detail
-
getEntity
String getEntity()
The entity name- Returns:
- the entity
-
getTtl
Optional<Duration> getTtl()
This duration set a time for data in an entity to expire. It defines the time to live of an object in a database.- Returns:
- the TTL otherwise
Optional.empty()
-
getConditions
List<Condition> getConditions()
The list of changes as conditions. Each condition will use the equals operator,Operator.EQUALS
, e.g., name = "any name"- Returns:
- the conditions
-
getValue
Optional<JSONQueryValue> getValue()
Returns the value to insert when the query uses JSON value instead of Conditions. In an insert, an operation is not able to use both:getConditions()
andgetValue()
. Therefore, execution will use just one operation type.- Returns:
- a
JSONQueryValue
orOptional.empty()
when it usesgetConditions()
-
parse
static InsertQuery parse(String query)
Obtains an instance ofInsertQuery.InsertQueryProvider
from a text string.- Parameters:
query
- the query- Returns:
InsertQuery.InsertQueryProvider
instance- Throws:
NullPointerException
- when the query is nullQuerySyntaxException
- if the text cannot be parsedProviderNotFoundException
- when the provider is not found
-
getProvider
static InsertQuery.InsertQueryProvider getProvider()
Returns theInsertQuery.InsertQueryProvider
instance- Returns:
- the InsertQueryProvider instance
- Throws:
ProviderNotFoundException
- when the provider is not found
-
-