Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ public Query<R> setOrder(Order<? super R> order) {
// Parameter registrations

@Override
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // This suppression is used to suppress unchecked conversion warnings that occur when converting a raw Class to a generic type.
// The underlying call to registerParameter is type-safe, so ignoring this warning is acceptable.
public ProcedureCallImplementor<R> registerStoredProcedureParameter(int position, Class type, ParameterMode mode) {
getSession().checkOpen( true );

Expand All @@ -443,7 +444,8 @@ public ProcedureCallImplementor<R> registerStoredProcedureParameter(int position
}

@Override
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // This suppression is used to suppress unchecked conversion warnings that occur when converting a raw Class to a generic type.
// The underlying call to registerParameter is type-safe, so ignoring this warning is acceptable.
public ProcedureCallImplementor<R> registerStoredProcedureParameter(
String parameterName,
Class type,
Expand Down Expand Up @@ -990,7 +992,10 @@ protected ScrollableResultsImplementor<R> doScroll(ScrollMode scrollMode) {
}

@Override
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // This suppression is used to suppress unchecked conversion warnings in two cases:
// 1. Returning Collections.EMPTY_LIST, which is a raw type, as a List<R>.
// 2. Casting the result of ResultSetOutput.getResultList() to List<R>.
// Both conversions are considered safe based on the intended usage.
public List<R> getResultList() {
if ( getMaxResults() == 0 ) {
return Collections.EMPTY_LIST;
Expand Down Expand Up @@ -1060,7 +1065,9 @@ else if ( resultList.size() > 1 ) {
}

@Override
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // This suppression is used to suppress unchecked cast warnings occurring when casting 'this', parameterMetadata,
// paramBindings, queryOptions, getSession(), or getOutputs() to the desired generic type T.
// Each cast is checked using cls.isInstance() or isAssignableFrom(), ensuring that the conversion is safe.
public <T> T unwrap(Class<T> cls) {
if ( cls.isInstance( this ) ) {
return (T) this;
Expand Down