public void setDefaultMapper(Type type, Mapper mapper) {
    if (mapper == null) {
      throw new IllegalArgumentException("mapper cannot be null");
    }
    lock.lock();
    try {
      cache.put(type, mapper);
    } finally {
      lock.unlock();
    }
  }
public void setDefaultMapper ( Type type , Mapper mapper ) { if ( mapper == null ) { throw new IllegalArgumentException ( "mapper cannot be null" ) ; } lock . lock ( ) ; try { cache . put ( type , mapper ) ; } finally { lock . unlock ( ) ; } }
Sets or registers the given mapper for the given type. This method must be called before
performing any persistence operations, preferably, during application startup. Entities that
were introspected before calling this method will NOT use the new mapper.

@param type
the type
@param mapper
the mapper to use for the given type