FileDocCategorySizeDatePackage
EJB30ConversionManager.javaAPI DocGlassfish v2 API3308Tue May 22 16:54:34 BST 2007oracle.toplink.essentials.internal.helper

EJB30ConversionManager

public class EJB30ConversionManager extends ConversionManager

Purpose: Extension to the existing conversion manager to support the EJB 3.0 spec.

Responsibilities:

  • Allow a null value default to be read into primitives. With the current conversion manager, setting a null into a primitive causes and exception. This conversion manager was added to avoid that exception and therefore, add support for schemas that were built before the object model was mapped (using a primitive). Therefore, TopLink will not change the null column value in the database through this conversion. The value on the dataabse will only be changed if the user actually sets a new primitive value.
  • Allows users to define their own set of default null values to be used in the conversion.
author
Guy Pelletier
since
TopLink 10.1.4 RI

Fields Summary
Constructors Summary
public EJB30ConversionManager()

        super();
    
Methods Summary
public java.lang.ObjectgetDefaultNullValue(java.lang.Class theClass)
INTERNAL:

        Object defaultNullValue = getDefaultNullValues().get(theClass);
        
        if (defaultNullValue == null && theClass.isPrimitive()) {
            return 0;
        } else {
            return defaultNullValue;
        }