- java.lang.Object
-
- io.rxmicro.data.sql.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:
- If the repository method returns or accepts the entity model as a parameter, the entity model class is used to define the variable value.
-
Otherwise, the RxMicro framework analyzes the optional entityClass parameter defined in the
Select,Insert,UpdateandDeleteannotations. - If the optional entityClass parameter is set, the class specified in this parameter is used to define the variable value.
-
If the optional entityClass parameter is missing, the RxMicro framework tries to extract the variable value from the
VariableValuesannotation, which annotates this repository method. -
If the repository method is not annotated with the
VariableValuesannotation or theVariableValuesannotation does not contain the value of a predefined variable, then the RxMicro framework tries to extract the value of this variable from theVariableValuesannotation, which annotates the repository interface. - 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 Summary
Fields Modifier and Type Field Description static StringALL_COLUMNSAll table columns defined at java class, separated by comma,.static StringBY_ID_FILTERBy primary key filters, separated by comma,.static StringID_COLUMNSPrimary keys defined at java class, separated by comma,.static StringINSERTED_COLUMNSTable columns defined at java class and available to insert to database table, separated by comma,.static StringTABLEDatabase full table name.static StringUPDATED_COLUMNSTable column set expressions defined at java class and available to update to database table, separated by comma,.static StringVALUESInsertable values, separated by comma,.
-
-
-
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, id2if primary key is complex For example:${id-columns} = idif 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 complexFor example:
${by-id-filter} = id = ?if primary key is simple- See Also:
- Constant Field Values
-
-