Class SimpleMapperOptions

    • Constructor Detail

      • SimpleMapperOptions

        public SimpleMapperOptions()
    • Method Detail

      • ttl

        public SimpleMapperOptions ttl​(int ttl)
        Adds time-to-live option to a mapper operation. This is only valid for save operations.

        Note that this option is only available if using ProtocolVersion.V2 or above.

        Parameters:
        ttl - the TTL (in seconds).
      • timestamp

        public SimpleMapperOptions timestamp​(long timestamp)
        Adds a timestamp option to a mapper operation. This is only valid for save and delete operations.

        Note that this option is only available if using ProtocolVersion.V2 or above.

        Parameters:
        timestamp - the timestamp (in microseconds).
      • consistencyLevel

        public SimpleMapperOptions consistencyLevel​(com.datastax.driver.core.ConsistencyLevel cl)
        Adds a consistency level value option to a mapper operation. This is valid for save, delete and get operations.

        Note that the consistency level can also be defined at the mapper level, as a parameter of the 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.

        Parameters:
        cl - the ConsistencyLevel to use for the operation.
      • tracing

        public SimpleMapperOptions tracing​(boolean enabled)
        Enables query tracing for a mapper operation. This is valid for save, delete and get operations.
        Parameters:
        enabled - whether to enable tracing.
      • saveNullFields

        public SimpleMapperOptions saveNullFields​(boolean enabled)
        Specifies whether null entity fields should be included in insert queries. This option is valid only for save operations.

        If this option is not specified, it defaults to true (null fields are saved).

        Parameters:
        enabled - whether to include null fields in queries.
      • ifNotExists

        public SimpleMapperOptions ifNotExists​(boolean enabled)
        Specifies whether an IF NOT EXISTS clause should be included in insert queries. This option is valid only for save operations.

        If this option is not specified, it defaults to false (IF NOT EXISTS statements are not used).

        Parameters:
        enabled - whether to include an IF NOT EXISTS clause in queries.
      • getMapperOptions

        public com.datastax.driver.mapping.Mapper.Option[] getMapperOptions()
        Description copied from interface: MapperOptions
        Returns an array of Mapper.Option that are used configure the mapper.
        Specified by:
        getMapperOptions in interface MapperOptions
        Returns:
        array of options used to configure the mapper.