@Override protected QueryException generateQueryException(String queryString) { return new QuerySyntaxException( getOriginalMessage(), queryString, this ); } }
/** * Locate the persister by class or entity name, requiring that such a persister * exist. * * @param name The class or entity name * * @return The defined persister for this entity * * @throws SemanticException Indicates the persister could not be found */ public EntityPersister requireClassPersister(String name) throws SemanticException { EntityPersister cp; try { cp = findEntityPersisterByName( name ); if ( cp == null ) { throw new QuerySyntaxException( name + " is not mapped" ); } } catch ( MappingException e ) { throw new DetailedSemanticException( e.getMessage(), e ); } return cp; }
/** * Converts the given ANTLR RecognitionException into a QuerySyntaxException. The RecognitionException * does not become the cause because ANTLR exceptions are not serializable. * * @param e The ANTLR exception * @param hql The query string * * @return The QuerySyntaxException */ public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
throw new QuerySyntaxException( comparisonText + " operator not supported on composite types." );
/** * Locate the persister by class or entity name, requiring that such a persister * exist. * * @param name The class or entity name * @return The defined persister for this entity * @throws SemanticException Indicates the persister could not be found */ public EntityPersister requireClassPersister(String name) throws SemanticException { EntityPersister cp; try { cp = findEntityPersisterByName( name ); if ( cp == null ) { throw new QuerySyntaxException( name + " is not mapped" ); } } catch ( MappingException e ) { throw new DetailedSemanticException( e.getMessage(), e ); } return cp; }
/** * Locate the persister by class or entity name, requiring that such a persister * exist. * * @param name The class or entity name * @return The defined persister for this entity * @throws SemanticException Indicates the persister could not be found */ public EntityPersister requireClassPersister(String name) throws SemanticException { EntityPersister cp; try { cp = findEntityPersisterByName( name ); if ( cp == null ) { throw new QuerySyntaxException( name + " is not mapped" ); } } catch ( MappingException e ) { throw new DetailedSemanticException( e.getMessage(), e ); } return cp; }
public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }
public static QuerySyntaxException convert(RecognitionException e, String hql) { String positionInfo = e.getLine() > 0 && e.getColumn() > 0 ? " near line " + e.getLine() + ", column " + e.getColumn() : ""; return new QuerySyntaxException( e.getMessage() + positionInfo, hql ); }