1 package org.hibernate.hql.classic; 3 4 import org.hibernate.QueryException; 5 import org.hibernate.persister.collection.CollectionPropertyNames; 6 import org.hibernate.type.Type; 7 8 public class FromPathExpressionParser extends PathExpressionParser { 9 10 public void end(QueryTranslatorImpl q) throws QueryException { 11 if ( !isCollectionValued() ) { 12 Type type = getPropertyType(); 13 if ( type.isEntityType() ) { 14 token( ".", q ); 16 token( null, q ); 17 } 18 else if ( type.isCollectionType() ) { 19 token( ".", q ); 21 token( CollectionPropertyNames.COLLECTION_ELEMENTS, q ); 22 } 23 } 24 super.end( q ); 25 } 26 27 protected void setExpectingCollectionIndex() throws QueryException { 28 throw new QueryException( "illegal syntax near collection-valued path expression in from: " + getCollectionName() ); 29 } 30 31 32 } 33 | Popular Tags |