What type would you map BigDecimal in Java/Hibernate in MySQL?
问题 After going through the previous develop's trainwreck of code I realized I need to move all of the money based columns to not use floating point math. On the Java side this means using BigDecimal but when using Hibernate/JPA and MySQL 5 what would be the appropriate MySQL data type to make that column? 回答1: DECIMAL and NUMERIC. The recommended Java mapping for the DECIMAL and NUMERIC types is java.math.BigDecimal. The java.math.BigDecimal type provides math operations to allow BigDecimal