Provide serialization example in the docs for Database storage of MonetaryAmount
Are there any samples on how to save MonetaryAmount on a database? I think this is very common use case, so the docs should include it.
I would at least propose two subtasks to this:
- [ ] Relational DB via Jadira Extended
- [ ] Non-Relational DBs via Jakarta NoSQL
https://github.com/JavaMoney/jsr354-ri/issues/185
You are welcome to send a PR to userguides. Actually the best guides are those which written by users when they had a question.
Good point, I am still learning the library, but when I get more comfortable with it I really might submit some guide.
I would also recommend a general guide on regular SQL, since many people (me included) aren't using any ORMs.
for general SQL you can store only cents (i.e. minor units) in long columns and then use the Money.ofMinorUnits(cents) method to create the Money instance
Oh, interesting, thanks!