Hi, looking at inline classes now. In our codebase we have
typealias Amount = BigDecimal
to mark amounts which have proper scaling and rounding. It serves well as a markier, but unfortunately doesn't help with compile time checking. I wonder if I can instead use inline classes. The problem is there is a lot of jackson mapping and JPA Hibernate mapping going on in the application. So I wonder
will inline classes "just work" with all this mappinng?
It’s been a while since I played with them though, so maybe the fact that you’re using a non-primitive BigDecimal as the inlined class won’t cause any problem.
jbnizet
12/28/2019, 5:07 PM
I can’t remember if I played with Hibernate, but since the compiler replaces the inline class by the actual one, I guess Hibernate shouldn’t even see a difference.
jbnizet
12/28/2019, 5:08 PM
I realize this doesn’t really answer your question 🙂. But anyway, I would be very happy to have your conclusions if you make some tests.