Class SupportedVariables


  • public final class SupportedVariables
    extends Object
    Supported variables that can be used in the SQL queries.

    To determine the value of the predefined variable used in the query specified for the repository method, the RxMicro framework uses the following algorithm:

    1. If the repository method returns or accepts the entity model as a parameter, the entity model class is used to define the variable value.
    2. Otherwise, the RxMicro framework analyzes the optional entityClass parameter defined in the Select, Insert, Update and Delete annotations.
    3. If the optional entityClass parameter is set, the class specified in this parameter is used to define the variable value.
    4. If the optional entityClass parameter is missing, the RxMicro framework tries to extract the variable value from the VariableValues annotation, which annotates this repository method.
    5. If the repository method is not annotated with the VariableValues annotation or the VariableValues annotation does not contain the value of a predefined variable, then the RxMicro framework tries to extract the value of this variable from the VariableValues annotation, which annotates the repository interface.
    6. If the variable value is undefined in all specified places, then the RxMicro framework notifies the developer about the error.
    Since:
    0.1
    Author:
    nedis
    See Also:
    Select, Insert, Update, Delete, VariableValues
    • Field Detail

      • TABLE

        public static final String TABLE
        Database full table name. i.e. if schema defined, then ${table} = schemaName.tableName}, otherwise ${table} = tableName}
        See Also:
        Constant Field Values
      • ALL_COLUMNS

        public static final String ALL_COLUMNS
        All table columns defined at java class, separated by comma ,.

        For example: ${all-columns} = id, login, name, password

        See Also:
        Constant Field Values
      • INSERTED_COLUMNS

        public static final String INSERTED_COLUMNS
        Table columns defined at java class and available to insert to database table, separated by comma ,.

        ${inserted-columns} = ${all-columns} minus {Columns annotated by @NotInsertable} minus {auto generated primary keys}

        For example: ${inserted-columns} = login, name, password

        See Also:
        Constant Field Values
      • UPDATED_COLUMNS

        public static final String UPDATED_COLUMNS
        Table column set expressions defined at java class and available to update to database table, separated by comma ,.

        ${updated-columns} = ${all-columns} minus {Columns annotated by @NotUpdatable} minus {primary keys}

        For example: ${updated-columns} = login = ?, name = ?, password = ?

        See Also:
        Constant Field Values
      • VALUES

        public static final String VALUES
        Insertable values, separated by comma ,.

        For example: ${values} = ?, ?, ?

        See Also:
        Constant Field Values
      • ID_COLUMNS

        public static final String ID_COLUMNS
        Primary keys defined at java class, separated by comma ,.

        ${id-columns} = {primary keys}

        For example: ${id-columns} = id1, id2 if primary key is complex For example: ${id-columns} = id if primary key is simple

        See Also:
        Constant Field Values
      • BY_ID_FILTER

        public static final String BY_ID_FILTER
        By primary key filters, separated by comma ,.

        For example: ${by-id-filter} = id1 = ? AND id2 = ? if primary key is complex

        For example: ${by-id-filter} = id = ? if primary key is simple

        See Also:
        Constant Field Values