vladmihalcea / hypersistence-utils

The Hypersistence Utils library (previously known as Hibernate Types) gives you Spring and Hibernate utilities that can help you get the most out of your data access layer.
Apache License 2.0
2.41k stars 368 forks source link

Add support for JavaMoney/Moneta/JSR 354 and/or Joda Money #286

Closed benstpierre closed 3 years ago

benstpierre commented 3 years ago

Maybe it would be super useful to implement support for Joda Money?

https://www.joda.org/joda-money/index.html

It seems a lot of people store money incorrectly in databases.

benstpierre commented 3 years ago

I noticed postgresql has a money type as well...

https://www.postgresql.org/docs/12/datatype-money.html

vladmihalcea commented 3 years ago

@benstpierre That's a good idea. If you submit a Pull Request, I'll review it when I have some time.

benstpierre commented 3 years ago

It seems that there is a newer better currency api here http://javamoney.github.io/ which has a jsr.

benstpierre commented 3 years ago

Looking around github it appears Jadira project already supports both JSR354 (javamoney) as well as Joda in their usertype library.

https://github.com/JadiraOrg/jadira/tree/master/usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency

vladmihalcea commented 3 years ago

Jadira supports encryption types too. If this is covered by Jadira, then this issue can be closed as there's no reason in reinventing the wheel.

benstpierre commented 3 years ago

What do you mean by encryption types?

vladmihalcea commented 3 years ago

That was Jasypt, not Jadira.