PostgreSQL JDBC Null String taken as a bytea

后端 未结 9 596
后悔当初
后悔当初 2020-12-10 02:59

If entity.getHistory() is null following code snippet:

(getEntityManager() returns spring injected EntityManager, database field history type is: text or varchar2(20

9条回答
  •  情歌与酒
    2020-12-10 03:22

    The JDBC setNull with sql type parameter is fallback for legacy JDBC drivers that do not pass the JDBC Driver Test Suite.

    One can guard against null errors within the query as follows:

    SELECT a FROM Author a WHERE :lastName IS NULL OR LOWER(a.lastName) = :lastName

    This should work in Postgresql after the fix of this issue.

提交回复
热议问题