What postgres column type would map to a Java Float type in a hibernate based column?
I have float(19) in my legacy postgres database but if hibernate schema validation is enabled I get this error message.
Wrong column type in realtorprint.templatetype for column height.
Found: float8, expected: float4
Any ideas? My column be float(8) instead of float(19) I can probably get this changed in our legacy database.
How hibernate maps Java Types to SQL Types is controlled by a subclass of Dialect corresponding to your RDBMS. Precisely which one you use may depend upon your version of both Hibernate and Postgres.
But I suspect in most cases, Java float maps to float(4) and Java double maps to float(8).
This being open source, you can get the code and check to be certain what’s happening in your case.
You can also substitute your own dialect through configuration, though it’s rarely appropriate. (It’s appropriate for bugfixes occasionally.)