Package org.apache.empire.db
Class DBGeneratedValue.DBFuncGeneratedValue
java.lang.Object
org.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBGeneratedValue
org.apache.empire.db.DBGeneratedValue.DBFuncGeneratedValue
- Enclosing class:
- DBGeneratedValue
DBFuncGeneratedValue
Auto-generates a record value from other record fields
The template must contain the column names wrapped in square brackets
like e.g. "normalize([name])" or "[lastName]+', '+[firstName]"
- Author:
- doebele
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.empire.db.DBGeneratedValue
DBGeneratedValue.DBFuncGeneratedValue, DBGeneratedValue.DBTriggerGeneratedValue -
Field Summary
Fields inherited from class org.apache.empire.db.DBGeneratedValue
db, logFields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESIS, CTX_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(Set<DBColumn> list) Internal function to obtain all DBColumnExpr-objects used by this expression.voidaddSQL(DBSQLBuilder sql, long context) Used to build the SQL command.Evaluates a record and returns the generated valuebooleanisModified(Record record) Returns true if the value was modified and thus needs to be be updated in the recordMethods inherited from class org.apache.empire.db.DBGeneratedValue
byFunction, byTrigger, getDatabaseMethods inherited from class org.apache.empire.db.DBObject
checkParamNull
-
Constructor Details
-
DBFuncGeneratedValue
-
-
Method Details
-
isModified
Description copied from class:DBGeneratedValueReturns true if the value was modified and thus needs to be be updated in the record- Specified by:
isModifiedin classDBGeneratedValue- Parameters:
record- the record for which to check- Returns:
- true if the value was modified and needs to be be updated
-
eval
Description copied from class:DBGeneratedValueEvaluates a record and returns the generated value- Specified by:
evalin classDBGeneratedValue- Parameters:
record- the record for which to evaluate- Returns:
- the generated value
-
addReferencedColumns
Description copied from class:DBExprInternal function to obtain all DBColumnExpr-objects used by this expression.- Specified by:
addReferencedColumnsin classDBExpr- Parameters:
list- list to which all used column expressions must be added
-
addSQL
Description copied from class:DBExprUsed to build the SQL command. SQL for this expression must be appended to StringBuilder.
-