Skip to content

Commit

Permalink
st-tu-dresden#345 - Upgrade to Moneta 1.4.2.
Browse files Browse the repository at this point in the history
Tweaked the implementation of MonetaryAmountAttributeConverter to workaround JavaMoney/jsr354-ri#357, as in 1.4 the toString() method returns a formatted value. We now extract currency code and numeric value explicitly ourselves.
  • Loading branch information
odrotbohm authored and svenkarol committed May 26, 2021
1 parent ce924bd commit b033163
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
<dependency>
<groupId>org.javamoney.moneta</groupId>
<artifactId>moneta-core</artifactId>
<version>1.4-tud</version>
<version>1.4.2</version>
</dependency>

<!-- For changelog creation -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MonetaryAmountAttributeConverter implements AttributeConverter<MonetaryAmo
*/
@Override
public String convertToDatabaseColumn(MonetaryAmount amount) {
return amount == null ? null : amount.toString();
return amount == null ? null : String.format("%s %s", amount.getCurrency().getCurrencyCode(), amount.getNumber());
}

/*
Expand Down

0 comments on commit b033163

Please sign in to comment.