Class SQLiteParameters

java.lang.Object
dev.rafex.ether.database.sqlite.sql.SQLiteParameters

public final class SQLiteParameters extends Object
SQLite-specific parameter helpers.

SQLite has a dynamic type system with five storage classes:

  • NULL
  • INTEGER (signed 64-bit)
  • REAL (64-bit floating point)
  • TEXT (UTF-8, UTF-16BE or UTF-16LE)
  • BLOB (binary data)
JSON support is available via the optional JSON1 extension.
  • Method Summary

    Modifier and Type
    Method
    Description
    static dev.rafex.ether.database.core.sql.SqlParameter
    blob(byte[] data)
    Creates a BLOB parameter for binary data.
    static dev.rafex.ether.database.core.sql.SqlParameter
    integer(Long value)
    Creates an INTEGER parameter.
    static dev.rafex.ether.database.core.sql.SqlParameter
    json(String json)
    Creates a JSON parameter.
    static dev.rafex.ether.database.core.sql.SqlParameter
    real(Double value)
    Creates a REAL (floating-point) parameter.
    static dev.rafex.ether.database.core.sql.SqlParameter
    text(String text)
    Creates a TEXT parameter.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • blob

      public static dev.rafex.ether.database.core.sql.SqlParameter blob(byte[] data)
      Creates a BLOB parameter for binary data.
      Parameters:
      data - the binary data, may be null
      Returns:
      a SqlParameter with type Types.BLOB
    • json

      public static dev.rafex.ether.database.core.sql.SqlParameter json(String json)
      Creates a JSON parameter.

      Note: Requires the JSON1 extension to be available at runtime. If the extension is not loaded, this will be treated as ordinary TEXT.

      Parameters:
      json - the JSON string, may be null
      Returns:
      a SqlParameter with type Types.OTHER
    • integer

      public static dev.rafex.ether.database.core.sql.SqlParameter integer(Long value)
      Creates an INTEGER parameter.
      Parameters:
      value - the integer value, may be null
      Returns:
      a SqlParameter with type Types.BIGINT
    • real

      public static dev.rafex.ether.database.core.sql.SqlParameter real(Double value)
      Creates a REAL (floating-point) parameter.
      Parameters:
      value - the floating-point value, may be null
      Returns:
      a SqlParameter with type Types.DOUBLE
    • text

      public static dev.rafex.ether.database.core.sql.SqlParameter text(String text)
      Creates a TEXT parameter.
      Parameters:
      text - the text value, may be null
      Returns:
      a SqlParameter with type Types.VARCHAR