Java Class Considerations - 7.3

Talend Data Mapper User Guide

Version
7.3
Language
English
Product
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2023-01-05
The Java importer generates a structure containing all of the fields or beans associated with your Java classes. One structure is created for each class, but they are connected using the inheritance mechanism, so they refer to each other just as they would when using Java pointers. The figure below shows a structure (from the examples) that has an Invoices class as the outer object, which refers to other classes such as Invoice, LineItem, and Contact.
When creating the structure definitions for your Java classes, you can choose to have the structure elements created for the Java fields or for the JavaBeans properties. This is specified when you import the Java classes and cannot be changed without reimporting.
  • Lists and Maps must include their types - A field or bean property that is just a java.util.List or java.util.Map will not work. Use java.util.List<ClassName> or java.util.Map<ClassName, ClassName>.

In the case where a field or bean refers to a class that has subclasses, an element with a group type of choice can be generated which has each known subclass as a member. In this way, it's easy to map the desired concrete subclass. The simple class name (that is, the name without the package) is used for each member.

Note that the JavaBeans properties are included even when only the getter or the setter is present, but not both.