theriom.com
This blog is mainly for me, a way of remembering things I've done; when I couldn't find an answer on Google, I wrote about it here. Hopefully, other people may find it helpful too.
Oracle Data Modeler Transformation Script to get Logical Type by Name

If you ever needed to change the logical data types via a transformation script, you’ll need to get the type by name. The lines below will get the logical type and place it in a variable for reuse.

var kBinaryType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Binary”); var kBooleanType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Boolean”); var kCharType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Char”); var kCurrencyType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Currency”); var kDateType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Date”); var kDateTimeType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“DateTime”); var kDecimalType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Decimal”); var kIntegerType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Integer”); var kStringType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“String”); var kTimeType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Time”); var kTimestampType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName(“Timestamp”);

for example :

attribute.setLogicalDatatype(kTimestampType);

Last modified on 2016-03-20