Package com.im.df.api.capabilities
Interface DFFieldFunctionCapability.Function
-
- Enclosing interface:
- DFFieldFunctionCapability
public static interface DFFieldFunctionCapability.Function
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
buidQuerySQL(DFTermExpression expr)
Build the SQL fragment that defines the part of the WHERE clause.java.lang.String
getSelectSQL()
Get the SQL that retrieves the values.boolean
isQueryable()
Not all functions will be queryable, or sensible to run queries against.
-
-
-
Method Detail
-
getSelectSQL
java.lang.String getSelectSQL()
Get the SQL that retrieves the values. This will be addded to the SELECT clause. In the case of a simple function that only uses columns from the main table this can just be the simple function e.g. "col1 + col2", but if the function is more complex (e.g. using columns from other tables) then it can be a sub-select e.g. "(SELECT avg(wombat_act_list.value_min)" (you must provide the outer brackets).- Returns:
- The SQL fragment
-
isQueryable
boolean isQueryable()
Not all functions will be queryable, or sensible to run queries against. These should return false.- Returns:
- Whether the function is queryable.
-
buidQuerySQL
java.lang.String buidQuerySQL(DFTermExpression expr)
Build the SQL fragment that defines the part of the WHERE clause. e.g. select ... from ... where ... and col1 + col2 < 100. If the function is not queryable this method can return null.- Parameters:
expr
- The query expression e.g. field < 100- Returns:
- The SQL fragment
-
-