public class SimpleMapperOptions extends Object implements MapperOptions
Constructor and Description |
---|
SimpleMapperOptions() |
Modifier and Type | Method and Description |
---|---|
SimpleMapperOptions |
consistencyLevel(com.datastax.driver.core.ConsistencyLevel cl)
Adds a consistency level value option to a mapper operation.
|
com.datastax.driver.mapping.Mapper.Option[] |
getMapperOptions()
Returns an array of
Mapper.Option that are used configure
the mapper. |
SimpleMapperOptions |
ifNotExists(boolean enabled)
Specifies whether an IF NOT EXISTS clause should be included in insert queries.
|
SimpleMapperOptions |
saveNullFields(boolean enabled)
Specifies whether null entity fields should be included in insert queries.
|
SimpleMapperOptions |
timestamp(long timestamp)
Adds a timestamp option to a mapper operation.
|
SimpleMapperOptions |
tracing(boolean enabled)
Enables query tracing for a mapper operation.
|
SimpleMapperOptions |
ttl(int ttl)
Adds time-to-live option to a mapper operation.
|
public SimpleMapperOptions ttl(int ttl)
Note that this option is only available if using ProtocolVersion.V2
or above.
ttl
- the TTL (in seconds).public SimpleMapperOptions timestamp(long timestamp)
Note that this option is only available if using ProtocolVersion.V2
or above.
timestamp
- the timestamp (in microseconds).public SimpleMapperOptions consistencyLevel(com.datastax.driver.core.ConsistencyLevel cl)
Note that the consistency level can also be defined at the mapper level, as a parameter of
the com.datastax.driver.mapping.annotations.Table
annotation (this is redundant for
backward compatibility). This option, whether defined on a specific call or as the default,
will always take precedence over the annotation.
cl
- the ConsistencyLevel
to use for the operation.public SimpleMapperOptions tracing(boolean enabled)
enabled
- whether to enable tracing.public SimpleMapperOptions saveNullFields(boolean enabled)
If this option is not specified, it defaults to true
(null fields are saved).
enabled
- whether to include null fields in queries.public SimpleMapperOptions ifNotExists(boolean enabled)
If this option is not specified, it defaults to false
(IF NOT EXISTS statements
are not used).
enabled
- whether to include an IF NOT EXISTS clause in queries.public com.datastax.driver.mapping.Mapper.Option[] getMapperOptions()
MapperOptions
Mapper.Option
that are used configure
the mapper.getMapperOptions
in interface MapperOptions
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.