KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > hql > ast > QuerySyntaxException


1 // $Id: QuerySyntaxException.java,v 1.1 2005/07/16 22:25:42 oneovthafew Exp $
2
package org.hibernate.hql.ast;
3
4 import antlr.RecognitionException;
5 import org.hibernate.QueryException;
6
7 /**
8  * Exception thrown when there is a syntax error in the HQL.
9  *
10  * @author josh Dec 5, 2004 7:22:54 PM
11  */

12 public class QuerySyntaxException extends QueryException {
13     
14     public QuerySyntaxException(RecognitionException e) {
15         super( e.getMessage() + (
16                 ( e.getLine() > 0 && e.getColumn() > 0 ) ?
17                 ( " near line " + e.getLine() + ", column " + e.getColumn() ) : ""
18                 ), e );
19     }
20
21     public QuerySyntaxException(RecognitionException e, String JavaDoc hql) {
22         super( e.getMessage() + (
23                 ( e.getLine() > 0 && e.getColumn() > 0 ) ?
24                 ( " near line " + e.getLine() + ", column " + e.getColumn() ) : ""
25                 ), e );
26         setQueryString( hql );
27     }
28     
29 }
30
Popular Tags