Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide serialization example in the docs for Database storage of MonetaryAmount #36

Open
2 tasks
feinstein opened this issue Dec 19, 2018 · 5 comments
Open
2 tasks

Comments

@feinstein
Copy link

feinstein commented Dec 19, 2018

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:

@feinstein feinstein changed the title Provide serialization example in the docs for Database storage Provide serialization example in the docs for Database storage of MonetaryAmount Dec 19, 2018
@stokito
Copy link
Member

stokito commented Dec 19, 2018

JavaMoney/jsr354-ri#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.

@feinstein
Copy link
Author

Good point, I am still learning the library, but when I get more comfortable with it I really might submit some guide.

@feinstein
Copy link
Author

I would also recommend a general guide on regular SQL, since many people (me included) aren't using any ORMs.

@stokito
Copy link
Member

stokito commented Dec 20, 2018

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

@feinstein
Copy link
Author

Oh, interesting, thanks!

@keilw keilw transferred this issue from JavaMoney/jsr354-ri Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants