You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently store MonetaryAmount values as String in the database and include the currency with it. This causes the sorting to break as the values are compared lexically rather than numerically. We essentially have two options:
Assume Euro as the only currency to be used with Salespoint – that would allow us to simply store the amount value and thus the database schema to change to a numeric value so that ordering works again. Downside of this: we'd rule out Salespoint to be used with multiple currencies. We could make the one currency to be used configurable, though.
Use better database mapping – We currently use JPA AttributeConverter implementations to store the MonetaryAmount values. Another option would be a Hibernate user type that supports mapping a value to multiple columns. That still raises the question of how that would behave in terms of ordering, as a mixture of currencies wouldn't sort properly without knowing the exchange rates.
The text was updated successfully, but these errors were encountered:
We currently store
MonetaryAmount
values asString
in the database and include the currency with it. This causes the sorting to break as the values are compared lexically rather than numerically. We essentially have two options:AttributeConverter
implementations to store theMonetaryAmount
values. Another option would be a Hibernate user type that supports mapping a value to multiple columns. That still raises the question of how that would behave in terms of ordering, as a mixture of currencies wouldn't sort properly without knowing the exchange rates.The text was updated successfully, but these errors were encountered: