Write not equal Restriction with Hibernate Criteria if the particular column is not null

is there any suggestion to solve in this version, because I have to change the Queries which is no longer supported in 5.2 version