Top Description Constructors Methods
org.hibernate.hql.internal.ast

public Class QuerySyntaxException

extends QueryException
Class Inheritance
Known Direct Subclasses
org.hibernate.hql.internal.ast.InvalidWithClauseException
Imports
org.hibernate.QueryException, antlr.RecognitionException

Exception thrown when there is a syntax error in the HQL.
Author
josh

Constructor Summary

AccessConstructor and Description
public
QuerySyntaxException(String
Message explaining the condition that led to the exception
message
)

Constructs a QuerySyntaxException

public
QuerySyntaxException(String
Message explaining the condition that led to the exception
message
,
String
The hql query that was being parsed/analyzed
hql
)

Constructs a QuerySyntaxException

protected
QuerySyntaxException(String
Message explaining the condition that led to the exception
message
,
String
The hql query that was being parsed/analyzed
queryString
,
Exception
The cause, generally another QuerySyntaxException
cause
)

Intended for use solely from generateQueryException(String)

Method Summary

Modifier and TypeMethod and Description
public static QuerySyntaxException

Returns:

The QuerySyntaxException
convert
(RecognitionException
The ANTLR exception
e
)

Converts the given ANTLR RecognitionException into a QuerySyntaxException.

public static QuerySyntaxException

Returns:

The QuerySyntaxException
convert
(RecognitionException
The ANTLR exception
e
,
String
The query string
hql
)

Converts the given ANTLR RecognitionException into a QuerySyntaxException.

protected QueryException
generateQueryException(String
The query string
queryString
)

Overrides org.hibernate.QueryException.generateQueryException.

Called from wrapWithQueryString(String) when we really need to generate a new QueryException (or subclass).
Inherited from org.hibernate.QueryException:
getMessagegetOriginalMessagegetQueryStringwrapWithQueryString

Constructor Detail

QuerySyntaxExceptionback to summary
public QuerySyntaxException(String message)

Constructs a QuerySyntaxException

Parameters
message:String

Message explaining the condition that led to the exception

QuerySyntaxExceptionback to summary
public QuerySyntaxException(String message, String hql)

Constructs a QuerySyntaxException

Parameters
message:String

Message explaining the condition that led to the exception

hql:String

The hql query that was being parsed/analyzed

QuerySyntaxExceptionback to summary
protected QuerySyntaxException(String message, String queryString, Exception cause)

Intended for use solely from generateQueryException(String)

Parameters
message:String

Message explaining the condition that led to the exception

queryString:String

The hql query that was being parsed/analyzed

cause:Exception

The cause, generally another QuerySyntaxException

Method Detail

convertback to summary
public static QuerySyntaxException convert(RecognitionException e)

Converts the given ANTLR RecognitionException into a QuerySyntaxException. The RecognitionException does not become the cause because ANTLR exceptions are not serializable.

Parameters
e:RecognitionException

The ANTLR exception

Returns:QuerySyntaxException

The QuerySyntaxException

convertback to summary
public static QuerySyntaxException convert(RecognitionException e, String hql)

Converts the given ANTLR RecognitionException into a QuerySyntaxException. The RecognitionException does not become the cause because ANTLR exceptions are not serializable.

Parameters
e:RecognitionException

The ANTLR exception

hql:String

The query string

Returns:QuerySyntaxException

The QuerySyntaxException

generateQueryExceptionback to summary
protected QueryException generateQueryException(String queryString)

Overrides org.hibernate.QueryException.generateQueryException.

Doc from org.hibernate.QueryException.generateQueryException.

Called from wrapWithQueryString(String) when we really need to generate a new QueryException (or subclass).

NOTE : implementors should take care to use getOriginalMessage() for the message, not getMessage()

Parameters
queryString:String

The query string

Returns:QueryException

The generated QueryException (or subclass)

Annotations
@Override