Converters and composers

Converters and composers are used to perform the mapping operation between an entity attribute and one or more table columns:

  • A converter maps one attribute to one column. Many converters are provided to convert SQL data into Java types, but you can write your own as well. A converter is specified in the mapping editor and is used for simple mapping.

  • A composer maps one attribute (which can be a complex class) to multiple table columns. A composer is specified in the mapping editor and is used for complex mapping.

    The mapping editor allows you to specify a “complex mapping” for a CMP field. When you use this option, you have to provide a composer class. You typically use this option for complex attributes, such as the ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.