I'm interested in incorporating JSR 354 Money API into my application and would like to be able to map MoneyAmount as Embeddable with JPA but we do not seem able to because the no-arg constructor of the Moneta implementation class is private and JPA (or at least Hibernate) requires it to be protected.
We tried to extend it to provide a protected constructor, but the class is final so can't to do that either.
First, assuming:
- I'm not the only one who might want to do that and
- Interoperability with JPA is important to this JSR
I'd suggest the spec to be enhanced to require implementations to provide a protected constructor for this purpose?
Secondly, would the Moneta RI team consider loosening the default arg constructor access to protected level? It should not have any downside if the class is final anyway?
Thirdly, if this change might take a while, can anyone think of an elegant workaround in the meantime (other than forking our own implementation)?
Jadira User Types has support of Moneta types maybe it can solve your problem.