MonetaryAmountAttributeConverter implements AttributeConverter<MonetaryAmount, String> { @Override public String convertToDatabaseColumn(MonetaryAmount amount) { return amount == null ? null : amount.toString(); }  @Override String convertToDatabaseColumn(MonetaryAmount amount); @Override MonetaryAmount convertToEntityAttribute(String source);  }
@Test void doesNotRoundValues() { assertThat(converter.convertToDatabaseColumn(Money.of(1.23456, "EUR"))).isEqualTo("EUR 1.23456"); }
@Test void doesNotFormatLargeValues() { assertThat(converter.convertToDatabaseColumn(Money.of(123456, "EUR"))).isEqualTo("EUR 123456"); }