Package st.orm.spi

Enum Class SqlOperation

java.lang.Object
java.lang.Enum<SqlOperation>
st.orm.spi.SqlOperation
All Implemented Interfaces:
Serializable, Comparable<SqlOperation>, Constable

public enum SqlOperation extends Enum<SqlOperation>
Represents the SQL mode.

The SQL mode provides context for the SqlTemplate processor, enabling validation and inference by the SQL template logic. Each mode indicates the type of SQL operation being performed, which allows the framework to adapt behavior accordingly.

  • Enum Constant Details

    • SELECT

      public static final SqlOperation SELECT
      Represents a SELECT operation.

      This mode is used for queries that retrieve data from the database without modifying its state. The SQL template processor uses this mode to validate that the query conforms to the structure of a SELECT statement.

    • INSERT

      public static final SqlOperation INSERT
      Represents an INSERT operation.

      This mode is used for queries that add new records to the database. The SQL template processor validates that parameters align with the fields being inserted.

    • UPDATE

      public static final SqlOperation UPDATE
      Represents an UPDATE operation.

      This mode is used for queries that modify existing records in the database. The SQL template processor ensures that the query includes a WHERE clause (if required) to avoid unintentional updates across all rows.

    • DELETE

      public static final SqlOperation DELETE
      Represents a DELETE operation.

      This mode is used for queries that remove records from the database. The SQL template processor validates the presence of a WHERE clause (if required) to prevent unintended deletion of all rows.

    • UNDEFINED

      public static final SqlOperation UNDEFINED
      Represents an undefined operation.

      This mode is used when the type of SQL operation cannot be determined. The SQL template processor may apply relaxed validation or inference rules when this mode is specified.

  • Method Details

    • values

      public static SqlOperation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SqlOperation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null