1 package org.hibernate.hql.ast.tree; 3 4 import antlr.SemanticException; 5 import antlr.collections.AST; 6 7 12 public class CollectionFunction extends MethodNode implements DisplayableNode { 13 public void resolve(boolean inSelect) throws SemanticException { 14 initializeMethodNode( this, inSelect ); 15 if ( !isCollectionPropertyMethod() ) { 16 throw new SemanticException( this.getText() + " is not a collection property name!" ); 17 } 18 AST expr = getFirstChild(); 19 if ( expr == null ) { 20 throw new SemanticException( this.getText() + " requires a path!" ); 21 } 22 resolveCollectionProperty( expr ); 23 } 24 25 protected void prepareSelectColumns(String [] selectColumns) { 26 String subselect = selectColumns[0].trim(); 28 if ( subselect.startsWith( "(") && subselect.endsWith( ")" ) ) { 29 subselect = subselect.substring( 1, subselect.length() -1 ); 30 } 31 selectColumns[0] = subselect; 32 } 33 } 34 | Popular Tags |