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

Add support for JavaMoney (JSR 354) with the MonetaryAmountType #450

Closed
piotrooo opened this issue Jul 4, 2022 · 4 comments
Closed

Add support for JavaMoney (JSR 354) with the MonetaryAmountType #450

piotrooo opened this issue Jul 4, 2022 · 4 comments
Milestone

Comments

@piotrooo
Copy link
Contributor

piotrooo commented Jul 4, 2022

In response to JavaMoney/jsr354-ri#185 (comment) maybe is a good idea to create issue here.

I think handling JavaMoney could be very useful.

This feature is in Jadira already (https://github.com/JadiraOrg/jadira/tree/master/usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/moneta) but seems it's looks like a little bit stale.

@vladmihalcea
Copy link
Owner

It's a good idea, indeed. Try creating a MonryType and some integration test to prove it and send me a Pull Request when it's done.

@piotrooo
Copy link
Contributor Author

piotrooo commented Jul 4, 2022

I think the very first implementation, should handle two concatenated columns. First one is for amount (sql decimal type), second for currency (sql varchar).

@Columns(columns = {@Column(name = "amount"), @Column(name = "currency")})

What do you think?

@vladmihalcea
Copy link
Owner

That could work via a Composite Type. There's no such example in the project at the moment, but you could try to create one.

@vladmihalcea vladmihalcea changed the title Add support for JavaMoney (JSR 354) type Add support for JavaMoney (JSR 354) with the MonetaryAmountType Jul 21, 2022
@vladmihalcea
Copy link
Owner

Thanks, I merged it.

@vladmihalcea vladmihalcea added this to the 2.17.0 milestone Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants