JavaMoney/javamoney-examples

Document how to store money using jpa

Opened this issue · 2 comments

I've found no documentation as how to store monetary amounts (e.g. FastMoney) using JPA. Since the classes are reasonably not annotated as @embeddable and have more than one attribute one needs a workaround for storing/retrieving them.
I've found org.jadira.usertype.moneyandcurrency.moneta.PersistentFastMoneyAmountAndCurrency but I am not sure if this is still the way to go (since jadira seems a little bit outdated)

I would propose to document this and as well provide an example in https://github.com/JavaMoney/javamoney-examples

keilw commented

Hi @SebastianDietrich Thank you very much, that is a very good idea. You are very welcome to propose something to javamoney-examples and also create a ticket there to track such an example.
Thanks,
Werner

@keilw that's ok for me since it seems to work with jadira in my application. But before enhancing the documentation and writing an "official" example I'd like to make sure that this is the way to go or if you are proposing a different approach / framework.