/** * Return the HQL query string that was invalid. */ public String getQueryString() { return ((QueryException) getCause()).getQueryString(); }
/** * Return the HQL query string that was invalid. */ public String getQueryString() { return ((QueryException) getCause()).getQueryString(); }
/** * Wraps this exception with another, of same kind, with the specified queryString. If this exception already * has a queryString defined, the same exception ({@code this}) is returned. Otherwise the protected * {@link #generateQueryException(String)} is called, to allow subclasses to properly create the correct * subclass for return. * * @param queryString The query string that led to the QueryException * * @return {@code this}, if {@code this} has {@code null} for {@link #getQueryString()}; otherwise a new * QueryException (or subclass) is returned. */ public final QueryException wrapWithQueryString(String queryString) { if ( this.getQueryString() != null ) { return this; } return generateQueryException( queryString ); }
if ( qe.getQueryString() == null ) { throw qe.wrapWithQueryString( queryString );
if ( qe.getQueryString() == null ) { throw qe.wrapWithQueryString( hql );
/** * Return the HQL query string that was invalid. */ public String getQueryString() { return ((QueryException) getCause()).getQueryString(); }
/** * Return the HQL query string that was invalid. */ public String getQueryString() { return ((QueryException) getCause()).getQueryString(); }
/** * Return the HQL query string that was invalid. */ public String getQueryString() { return ((QueryException) getCause()).getQueryString(); }
/** * Wraps this exception with another, of same kind, with the specified queryString. If this exception already * has a queryString defined, the same exception ({@code this}) is returned. Otherwise the protected * {@link #generateQueryException(String)} is called, to allow subclasses to properly create the correct * subclass for return. * * @param queryString The query string that led to the QueryException * * @return {@code this}, if {@code this} has {@code null} for {@link #getQueryString()}; otherwise a new * QueryException (or subclass) is returned. */ public final QueryException wrapWithQueryString(String queryString) { if ( this.getQueryString() != null ) { return this; } return generateQueryException( queryString ); }
private static net.sf.hibernate.QueryException adaptQueryException( final org.hibernate.QueryException ex) { final String message = ex.getMessage(); final net.sf.hibernate.QueryException result = new net.sf.hibernate.QueryException(ex) { @Override public String getMessage() { return message; } @Override public String toString() { return toStringWithClassName(this, net.sf.hibernate.QueryException.class); } }; result.setQueryString(ex.getQueryString()); return result; }