Problem
Recently we migrated Hibernate to the latest version i.e. 5.4.4. Multiple depreciation warnings appeared in our code i.e.- The type Query<R> is deprecated
- The method setString(String, String) from the type Query is deprecated
- The method uniqueResult() from the type Query is deprecated
- The method setBoolean(String, boolean) from the type Query is deprecated
- The method setLong(String, long) from the type Query is deprecated
Solution
Existing
|
Change To
|
import org.hibernate.Query;
|
import org.hibernate.query.Query;
|
query.
|
query.setParameter("serviceId", serviceId );
|
query.
|
query. setParameter ("isDelete",Boolean.FALSE );
|
query.
|
query. setParameter ("serviceNo", serviceNo);
|
Please leave your comments in the comment box.
Comments
Post a Comment