Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Aggregator Transformation
  4. Custom Transformation
  5. Custom Transformation Functions
  6. Data Masking Transformation
  7. Data Masking Examples
  8. Expression Transformation
  9. External Procedure Transformation
  10. Filter Transformation
  11. HTTP Transformation
  12. Identity Resolution Transformation
  13. Java Transformation
  14. Java Transformation API Reference
  15. Java Expressions
  16. Java Transformation Example
  17. Joiner Transformation
  18. Lookup Transformation
  19. Lookup Caches
  20. Dynamic Lookup Cache
  21. Normalizer Transformation
  22. Rank Transformation
  23. Router Transformation
  24. Sequence Generator Transformation
  25. Sorter Transformation
  26. Source Qualifier Transformation
  27. SQL Transformation
  28. Using the SQL Transformation in a Mapping
  29. Stored Procedure Transformation
  30. Transaction Control Transformation
  31. Union Transformation
  32. Unstructured Data Transformation
  33. Update Strategy Transformation
  34. XML Transformations

Transformation Guide

Transformation Guide

Data Type Conversion

Data Type Conversion

A Java transformation converts
PowerCenter
data types to Java data types, based on the Java transformation port type.
When a Java transformation reads input rows, it converts input port data types to Java data types.
When a Java transformation writes output rows, it converts Java data types to output port data types.
For example, the following processing occurs for an input port with the integer data type in a Java transformation:
  1. The Java transformation converts the integer data type of the input port to the Java primitive int data type.
  2. In the transformation, the transformation treats the value of the input port as the Java primitive int data type.
  3. When the transformation generates the output row, it converts the Java primitive int data type to the integer data type.
The following table shows how the Java transformation maps
PowerCenter
data types to Java primitive and complex data types:
PowerCenter Data Type
Java Data Type
Char
String
Binary
byte[]
Long (INT32)
int
Double
double
Decimal
double
BigDecimal
BIGINT
long
Date/Time
BigDecimal
long (number of milliseconds since January 1, 1970 00:00:00.000 GMT)
The Java transformation sets null values in primitive data types to zero. You can use the isNull and the setNull API methods on the
On Input Row
tab to set null values in the input port to null values in the output port. For an example, see setNull.
The decimal data type maps to BigDecimal when high precision is enabled. BigDecimal cannot be used with some operators, such as the
+
operator. If the Java code contains an expression that uses a decimal port and the port is used with one of the operators, the Java code fails to compile.

0 COMMENTS

We’d like to hear from you!