Class HibernateProxyDozerFieldMapper

java.lang.Object
com.foreach.across.modules.hibernate.util.HibernateProxyDozerFieldMapper
All Implemented Interfaces:
com.github.dozermapper.core.CustomFieldMapper

public class HibernateProxyDozerFieldMapper extends Object implements com.github.dozermapper.core.CustomFieldMapper
CustomFieldMapper that initializes a non-hibernate initialized lazy field via a new session upon the first request to the object. The object is then also mapped to a dto via a given Mapper instance before the resulting object is actually accessed. If for some reason the mapping of the hibernate object fails, the hibernate initialized version will be accessed instead.
  • Constructor Details

    • HibernateProxyDozerFieldMapper

      public HibernateProxyDozerFieldMapper(com.github.dozermapper.core.Mapper mapper, HibernateSessionHolder hibernateSessionHolder)
  • Method Details

    • mapField

      public boolean mapField(Object source, Object destination, Object sourceFieldValue, com.github.dozermapper.core.classmap.ClassMap classMap, com.github.dozermapper.core.fieldmap.FieldMap fieldMapping)
      Specified by:
      mapField in interface com.github.dozermapper.core.CustomFieldMapper