deprecated some exception constructors we need to migrate away from

it's really important to report the actual HQL that caused the failure
This commit is contained in:
Gavin 2023-06-12 23:38:01 +02:00 committed by Gavin King
parent e2cf383f7a
commit d43f618eba
3 changed files with 28 additions and 1 deletions

View File

@ -17,7 +17,11 @@ public class QueryException extends HibernateException {
* Constructs a {@code QueryException} using the specified exception message.
*
* @param message A message explaining the exception condition
*
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3")
public QueryException(String message) {
this( message, null, null );
}
@ -27,7 +31,11 @@ public class QueryException extends HibernateException {
*
* @param message A message explaining the exception condition
* @param cause The underlying cause
*
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3")
public QueryException(String message, Exception cause) {
this( message, null, cause );
}
@ -58,7 +66,11 @@ public class QueryException extends HibernateException {
* Constructs a {@code QueryException} using the specified cause.
*
* @param cause The underlying cause
*
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3")
public QueryException(Exception cause) {
this( "A query exception occurred", null, cause );
}

View File

@ -13,14 +13,29 @@ package org.hibernate.query;
* @author Steve Ebersole
*/
public class SemanticException extends org.hibernate.QueryException {
/**
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3")
public SemanticException(String message) {
super( message );
}
/**
* @deprecated this constructor does not carry information
* about the query which caused the failure
*/
@Deprecated(since = "6.3")
public SemanticException(String message, Exception cause) {
super( message, cause );
}
public SemanticException(String message, String queryString) {
super( message, queryString );
}
public SemanticException(String message, String queryString, Exception cause) {
super( message, queryString, cause );
}

View File

@ -10,7 +10,7 @@ import org.hibernate.QueryException;
/**
* Represents a general uncaught problem performing the interpretation.
* This usually indicate a semantic error in the query.
* This usually indicates a semantic error in the query.
*
* @author Steve Ebersole
*/