BigInteger mapped to SqlTypes.NUMERIC instead of SqlTypes.BIGINT

Thank you for your reply.

I find it quite counterintuitive that, for a BIGINT column in PostgreSQL, java.lang.BigInteger is not the appropriate type to use, especially when working with indexed columns. It took me a while to understand why my DB index wasn’t being used. Even my profiler, VisualVM, didn’t reveal the cast to numeric in the SQL queries.

My knowledge in this area isn’t deep enough to know whether something could be done, at the level of Hibernate, PostgreSQL, VisualVM, or the JDBC driver, to at least warn developers when this happens. Just a thought. In any case, thank you again for your answer.