Skip to content

Commit

Permalink
SAK-45811 Deprecated Query setString, setBoolean => setParameter (sak…
Browse files Browse the repository at this point in the history
  • Loading branch information
axxter99 authored Jul 20, 2021
1 parent da84f79 commit a2dccb9
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,9 @@ protected void resetPlacementDefaultChannel(String context, String placement) {
try {
session = getSessionFactory().getCurrentSession();
Query query = session.createSQLQuery("update CHAT2_CHANNEL c set c.placementDefaultChannel = :channel, c.PLACEMENT_ID = NULL WHERE c.context = :context and c.PLACEMENT_ID = :placement");
query.setBoolean("channel", false);
query.setString("context", context);
query.setString("placement", placement);
query.setParameter("channel", false);
query.setParameter("context", context);
query.setParameter("placement", placement);
query.executeUpdate();
} catch(Exception e) {
log.warn(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public Type getType(final String uuid)
public Object doInHibernate(Session session) throws HibernateException
{
Query q = session.getNamedQuery(FINDTYPEBYUUID);
q.setString(UUID, uuid);
q.setParameter(UUID, uuid);
q.setCacheable(cacheFindTypeByUuid);
return q.uniqueResult();
}
Expand Down Expand Up @@ -159,9 +159,9 @@ public Type getType(final String authority, final String domain, final String ke
public Object doInHibernate(Session session) throws HibernateException
{
Query q = session.getNamedQuery(FINDTYPEBYTUPLE);
q.setString(AUTHORITY, authority);
q.setString(DOMAIN, domain);
q.setString(KEYWORD, keyword);
q.setParameter(AUTHORITY, authority);
q.setParameter(DOMAIN, domain);
q.setParameter(KEYWORD, keyword);
q.setCacheable(cacheFindTypeByTuple);
return q.uniqueResult();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ private PrivacyRecord getPrivacy(final String contextId, final String userId, fi

HibernateCallback<PrivacyRecord> hcb = session -> {
Query q = session.getNamedQuery(QUERY_BY_USERID_CONTEXTID_TYPEID);
q.setString(CONTEXT_ID, contextId);
q.setString(USER_ID, userId);
q.setString(RECORD_TYPE, recordType);
q.setParameter(CONTEXT_ID, contextId);
q.setParameter(USER_ID, userId);
q.setParameter(RECORD_TYPE, recordType);
return (PrivacyRecord) q.uniqueResult();
};

Expand Down Expand Up @@ -637,9 +637,9 @@ private List<PrivacyRecord> getViewableStateList(final String contextId, final B

HibernateCallback<List<PrivacyRecord>> hcb = session -> {
Query q = session.getNamedQuery(QUERY_BY_CONTEXT_VIEWABLE_TYPE);
q.setString(CONTEXT_ID, contextId);
q.setBoolean(VIEWABLE, viewable);
q.setString(RECORD_TYPE, recordType);
q.setParameter(CONTEXT_ID, contextId);
q.setParameter(VIEWABLE, viewable);
q.setParameter(RECORD_TYPE, recordType);
return q.list();
};

Expand All @@ -655,9 +655,9 @@ private List<PrivacyRecord> getViewableStateList(final String contextId, final B

HibernateCallback<List<PrivacyRecord>> hcb = session -> {
Query q = session.getNamedQuery(QUERY_BY_CONTEXT_VIEWABLE_TYPE_IDLIST);
q.setString(CONTEXT_ID, contextId);
q.setBoolean(VIEWABLE, viewable);
q.setString(RECORD_TYPE, recordType);
q.setParameter(CONTEXT_ID, contextId);
q.setParameter(VIEWABLE, viewable);
q.setParameter(RECORD_TYPE, recordType);
q.setParameterList("userIds", userIds);
return q.list();
};
Expand All @@ -674,8 +674,8 @@ private List<PrivacyRecord> getPrivacyByContextAndType(final String contextId, f

HibernateCallback<List<PrivacyRecord>> hcb = session -> {
Query q = session.getNamedQuery(QUERY_BY_CONTEXT__TYPE);
q.setString(CONTEXT_ID, contextId);
q.setString(RECORD_TYPE, recordType);
q.setParameter(CONTEXT_ID, contextId);
q.setParameter(RECORD_TYPE, recordType);
return q.list();
};

Expand All @@ -691,8 +691,8 @@ private List<PrivacyRecord> getPrivacyByContextAndTypeAndUserIds(final String co

HibernateCallback<List<PrivacyRecord>> hcb = session -> {
Query q = session.getNamedQuery(QUERY_BY_CONTEXT__TYPE_IDLIST);
q.setString(CONTEXT_ID, contextId);
q.setString(RECORD_TYPE, recordType);
q.setParameter(CONTEXT_ID, contextId);
q.setParameter(RECORD_TYPE, recordType);
q.setParameterList("userIds", userIds);
q.setCacheable(true);
return q.list();
Expand Down
Loading

0 comments on commit a2dccb9

Please sign in to comment.