Open Source Repository

Home /hibernate/hibernate-3.2.7.ga | Repository Home



org/hibernate/hql/ast/QuerySyntaxException.java
// $Id: QuerySyntaxException.java 9242 2006-02-09 12:37:36Z steveebersole $
package org.hibernate.hql.ast;

import antlr.RecognitionException;
import org.hibernate.QueryException;

/**
 * Exception thrown when there is a syntax error in the HQL.
 *
 @author josh
 */
public class QuerySyntaxException extends QueryException {

  public QuerySyntaxException(String message) {
    supermessage );
  }

  public QuerySyntaxException(String message, String hql) {
    thismessage );
    setQueryStringhql );
  }

  public static QuerySyntaxException convert(RecognitionException e) {
    return converte, null );
  }

  public static QuerySyntaxException convert(RecognitionException e, String hql) {
    String positionInfo = e.getLine() && e.getColumn() 0
        " near line " + e.getLine() ", column " + e.getColumn()
        "";
    return new QuerySyntaxExceptione.getMessage() + positionInfo, hql );
  }

}