use of com.developmentontheedge.be5.metadata.model.ColumnFunction in project be5 by DevelopmentOnTheEdge.
the class SqlServerTypeManager method getTypeClause.
@Override
public String getTypeClause(ColumnDef column) {
if (column.getDefaultValue() != null) {
String defaultValue = getDefaultValue(column);
ColumnFunction function = new ColumnFunction(defaultValue);
if (function.isTransformed()) {
return "";
}
}
return super.getTypeClause(column);
}
use of com.developmentontheedge.be5.metadata.model.ColumnFunction in project be5 by DevelopmentOnTheEdge.
the class OracleTypeManager method getColumnTriggerDefinition.
@Override
public String getColumnTriggerDefinition(ColumnDef column) {
String defaultValue = column.getDefaultValue();
if (defaultValue == null)
return "";
ColumnFunction function = new ColumnFunction(defaultValue);
if (ColumnFunction.TRANSFORM_GENERIC.equals(function.getTransform())) {
return "CREATE OR REPLACE TRIGGER " + getTriggerName(column) + "\nBEFORE INSERT OR UPDATE OF " + normalizeIdentifier(function.getColumnName()) + " ON " + normalizeIdentifier(column.getEntity().getName()) + "\nFOR EACH ROW" + "\nBEGIN" + "\n :new." + normalizeIdentifier(column.getName()) + " := '" + column.getEntity().getName() + ".' || :new." + normalizeIdentifier(function.getColumnName()) + ";" + "\nEND;\n";
}
return "";
}
Aggregations