What is the recommended way to keep / map Java Hibernate entity -> PostgreSQL for the type BigDecimal? Right now I keep them as simple VARCHAR (character varying) and I have no problems with "float values inequality" (where any random number appears on the high position) but when the data is being displayed (hundreds of thousand rows) in tables (in my solution) I need to convert String to BigDecimal as data can be sorted. I consider to swap VARCHAR to NUMERIC(19,4).
- Would be nice if I would force BigDecimals from my entity to keep ALWAYS scale == *4.
- Does the problem with "float - values inequality" occures when NUMBER(19, 4) will be used?