Hibernate ORM QueryException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM QueryException class.

This code example shows how to use the following methods:getMessage
 */ 
@SuppressWarnings("serial") 
public class HibernateQueryException extends InvalidDataAccessResourceUsageException {
 
	public HibernateQueryException(QueryException ex) {
		super(ex.getMessage(), ex);
	} 
 
	/** 
	 * Return the HQL query string that was invalid. 
	 */ 
	public String getQueryString() {
		return ((QueryException) getCause()).getQueryString();
	} 
 
} 
8
CodeRank
This code example shows how to use the following methods:getMessage
 */ 
@SuppressWarnings("serial") 
public class HibernateQueryException extends InvalidDataAccessResourceUsageException {
 
	public HibernateQueryException(QueryException ex) {
		super(ex.getMessage(), ex);
	} 
 
	/** 
	 * Return the HQL query string that was invalid. 
	 */ 
	public String getQueryString() {
		return ((QueryException) getCause()).getQueryString();
	} 
 
} 
8
CodeRank
This code example shows how to use the following methods:getMessage
import org.hibernate.PessimisticLockException;
import org.hibernate.PropertyValueException;
import org.hibernate.QueryException;
import org.hibernate.QueryTimeoutException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.StaleObjectStateException;
import org.hibernate.StaleStateException;
import org.hibernate.TransientObjectException;
import org.hibernate.UnresolvableObjectException;
import org.hibernate.WrongClassException;
import org.hibernate.dialect.lock.OptimisticEntityLockException;
import org.hibernate.dialect.lock.PessimisticEntityLockException;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.exception.DataException;
import org.hibernate.exception.JDBCConnectionException;
import org.hibernate.exception.LockAcquisitionException;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.service.spi.Wrapped;
8
CodeRank
This code example shows how to use the following methods:getMessage
import org.hibernate.Criteria; 
import org.hibernate.FlushMode; 
import org.hibernate.HibernateException; 
import org.hibernate.Interceptor; 
import org.hibernate.JDBCException; 
import org.hibernate.NonUniqueObjectException; 
import org.hibernate.NonUniqueResultException; 
import org.hibernate.ObjectDeletedException; 
import org.hibernate.OptimisticLockException; 
import org.hibernate.PersistentObjectException; 
import org.hibernate.PessimisticLockException; 
import org.hibernate.PropertyValueException; 
import org.hibernate.Query; 
import org.hibernate.QueryException; 
import org.hibernate.QueryTimeoutException; 
import org.hibernate.Session; 
import org.hibernate.SessionFactory; 
import org.hibernate.StaleObjectStateException; 
import org.hibernate.StaleStateException; 
import org.hibernate.TransientObjectException; 
7
CodeRank
This code example shows how to use the following methods:
			} 
			else if ( ")".equals( token ) ) {
				currentCollectionProp = null;
				return; 
			} 
			else { 
				token = StringHelper.qualify( token, currentCollectionProp );
			} 
		} 
		else { 
			String prop = CollectionProperties.getNormalizedPropertyName( token.toLowerCase() );
			if ( prop != null ) {
				currentCollectionProp = prop;
				return; 
			} 
		} 
 
 
		//handle <=, >=, !=, is not, not between, not in 
		if ( lastToken == null ) {
5
CodeRank
This code example shows how to use the following methods:
	public Type toType(String propertyName) throws QueryException {
		if ( propertyName==null || "id".equals(propertyName) ) {
			return type;
		} 
		else { 
			throw new QueryException("cannot dereference scalar collection element: " + propertyName);
		} 
	} 
 
	public String[] toColumns(String alias, String propertyName) throws QueryException {
		if (propertyName==null || "id".equals(propertyName) ) {
			return StringHelper.qualify( alias, elementColumns );
		} 
		else { 
			throw new QueryException("cannot dereference scalar collection element: " + propertyName);
		} 
	} 
 
	/** 
	 * Given a property path, return the corresponding column name(s). 
5
CodeRank
This code example shows how to use the following methods:
		else if ( propertyName.equals(CollectionPropertyNames.COLLECTION_MIN_ELEMENT) ) {
			return memberPersister.getElementType();
		} 
		else { 
			//return memberPersister.getPropertyType(propertyName); 
			throw new QueryException("illegal syntax near collection: " + propertyName);
		} 
	} 
 
	public String[] toColumns(String alias, String propertyName) throws QueryException {
		if ( propertyName.equals(CollectionPropertyNames.COLLECTION_ELEMENTS) ) {
			return memberPersister.getElementColumnNames(alias);
		} 
		else if ( propertyName.equals(CollectionPropertyNames.COLLECTION_INDICES) ) {
			if ( !memberPersister.hasIndex() ) throw new QueryException("unindexed collection in indices()");
			return memberPersister.getIndexColumnNames(alias);
		} 
		else if ( propertyName.equals(CollectionPropertyNames.COLLECTION_SIZE) ) {
			String[] cols = memberPersister.getKeyColumnNames();
			return new String[] { "count(" + alias + '.' + cols[0] + ')' };
5
CodeRank
This code example shows how to use the following methods:
		} 
		catch ( Exception e ) {
			throw new QueryException( "collection role not found: " + role );
		} 
	} 
 
	public final TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
	        throws HibernateException {
		return NO_VALUES;
	} 
 
	public final String toString() {
		return propertyName + ( excludeEmpty() ? " is not empty" : " is empty" );
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
			if ( cacheSelectTokens ) {
				selectTokens.add( token );
			} 
			else { 
				if ( child == null ) {
					throw new QueryException( "query must begin with SELECT or FROM: " + token );
				} 
				else { 
					child.token( token, q );
				} 
			} 
		} 
 
	} 
 
	private void endChild(QueryTranslatorImpl q) throws QueryException {
		if ( child == null ) {
			//null child could occur for no from clause in a filter 
			cacheSelectTokens = false;
		} 
5
CodeRank
This code example shows how to use the following methods:
	} 
 
	protected void setPossibleID(boolean possibleID) { 
		this.possibleID = possibleID; 
	} 
 
	protected Token makeToken(int i) { 
		HqlToken token = ( HqlToken ) super.makeToken( i ); 
		token.setPossibleID( possibleID ); 
		possibleID = false; 
		return token; 
	} 
 
	public int testLiteralsTable(int i) { 
		int ttype = super.testLiteralsTable( i ); 
		return ttype; 
	} 
 
	public void panic() { 
		//overriden to avoid System.exit 
5
CodeRank