LocaleMapper extends Mapper<Locale> { @Nullable @Override public Object toDb(@Nullable final Locale value) throws MapperException { if (value == null) { return null; } return value.toString(); }  @Nullable @Override Locale fromDb(@Nullable final Object dbValue); @Nullable @Override Object toDb(@Nullable final Locale value);  }
@Test public void testToDb() throws MapperException { LOG.info("testToDb"); Assert.assertEquals("en", mapper.toDb(Locale.ENGLISH)); Assert.assertEquals("en_US", mapper.toDb(Locale.US)); Assert.assertEquals("nl_NL", mapper.toDb(new Locale("nl", "NL"))); Assert.assertEquals("es_ES_Traditional_WIN", mapper.toDb(new Locale("es", "ES", "Traditional_WIN"))); }