public abstract class DBGeneratedValue extends DBExpr
| Modifier and Type | Class and Description |
|---|---|
static class |
DBGeneratedValue.DBFuncGeneratedValue
DBFuncGeneratedValue
Auto-generates a record value from other record fields
The template must contain the column names wrapped in square brackets
like e.g.
|
static class |
DBGeneratedValue.DBTriggerGeneratedValue
DBTriggerGeneratedValue
Value is generated by Trigger
|
| Modifier and Type | Field and Description |
|---|---|
protected DBDatabase |
db |
protected static org.slf4j.Logger |
log |
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE| Constructor and Description |
|---|
DBGeneratedValue(DBDatabase db) |
| Modifier and Type | Method and Description |
|---|---|
static DBGeneratedValue |
byFunction(DBTable table,
String functionTemplate)
Returns generator for a record value created from other record fields
The function template must contain the column names wrapped in square brackets
like e.g.
|
static DBGeneratedValue |
byTrigger(DBTable table,
String triggerName,
DBTableColumn... columns)
Returns a generated value for a trigger
|
abstract Object |
eval(Record record)
Evaluates a record and returns the generated value
|
<T extends DBDatabase> |
getDatabase()
Returns the database object to which this object belongs to.
|
abstract boolean |
isModified(Record record)
Returns true if the value was modified and thus needs to be be updated in the record
|
addReferencedColumns, addSQLcheckParamNullprotected static final org.slf4j.Logger log
protected final DBDatabase db
public DBGeneratedValue(DBDatabase db)
public static DBGeneratedValue byTrigger(DBTable table, String triggerName, DBTableColumn... columns)
table - the table on which the triggertriggerName - then name of the triggercolumns - the list of columns used by the triggerpublic static DBGeneratedValue byFunction(DBTable table, String functionTemplate)
table - the table for which the value is generatedpublic abstract boolean isModified(Record record)
record - the record for which to checkpublic abstract Object eval(Record record)
record - the record for which to evaluatepublic <T extends DBDatabase> T getDatabase()
DBObjectgetDatabase in class DBObjectT - the object typeCopyright © 2008–2023 Apache Software Foundation. All rights reserved.