Skip to content
Merged
Show file tree
Hide file tree
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 @@ -80,7 +80,7 @@ public SQLStateConversionDelegate(ConversionContext conversionContext) {
return new JDBCConnectionException( message, sqlException, sql );
case
"21", // "cardinality violation"
"22": // "data exception" (22001 is string too long)
"22": // "data exception" (22001 is string too long; 22003 is numeric value out of range)
return new DataException( message, sqlException, sql );
case
"28": // "authentication failure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class NativeQueryConstructorTransformer<T> implements TupleTransformer<T> {

private final Class<T> resultClass;
private Constructor<T> constructor;
private transient Constructor<T> constructor;

private Constructor<T> constructor(Object[] elements) {
if ( constructor == null ) {
Expand Down Expand Up @@ -75,4 +75,16 @@ public T transformTuple(Object[] tuple, String[] aliases) {
throw new InstantiationException( "Cannot instantiate query result type", resultClass, e );
}
}

@Override
public boolean equals(Object obj) {
return obj instanceof NativeQueryConstructorTransformer<?> that
&& this.resultClass == that.resultClass;
// should be safe to ignore the cached constructor here
}

@Override
public int hashCode() {
return resultClass.hashCode();
}
}