[hibernate-commits] Hibernate SVN: r16427 - in core/branches/antlr3/src/main: java/org/hibernate/sql/ast/common and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Apr 23 12:12:38 EDT 2009


Author: porcelli
Date: 2009-04-23 12:12:38 -0400 (Thu, 23 Apr 2009)
New Revision: 16427

Modified:
   core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/resolve/GeneratedHQLResolver.g
   core/branches/antlr3/src/main/java/org/hibernate/sql/ast/common/HibernateTree.java
Log:
implementing the indexed properties resolver

Modified: core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/resolve/GeneratedHQLResolver.g
===================================================================
--- core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/resolve/GeneratedHQLResolver.g	2009-04-23 16:01:18 UTC (rev 16426)
+++ core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/resolve/GeneratedHQLResolver.g	2009-04-23 16:12:38 UTC (rev 16427)
@@ -46,8 +46,8 @@
 }
 
 @members{
-    protected void registerPersisterSpace(CommonTree entityName,
-                                       CommonTree alias) {
+    protected void registerPersisterSpace(Tree entityName,
+                                       Tree alias) {
         throw new UnsupportedOperationException( "must be overridden!" );
     }
     
@@ -55,7 +55,7 @@
         throw new UnsupportedOperationException( "must be overridden!" );
 	}	
 
-	protected PathedPropertyReferenceSource normalizeUnqualifiedPropertyReference(CommonTree property) {
+	protected PathedPropertyReferenceSource normalizeUnqualifiedPropertyReference(Tree property) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 	
@@ -63,39 +63,40 @@
         throw new UnsupportedOperationException( "must be overridden!" );
     }
 
-    protected PathedPropertyReferenceSource normalizeUnqualifiedRoot( CommonTree identifier382 ) {
+    protected PathedPropertyReferenceSource normalizeUnqualifiedRoot( Tree identifier382 ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 
-	protected PathedPropertyReferenceSource normalizeQualifiedRoot( CommonTree identifier381 ) {
+	protected PathedPropertyReferenceSource normalizeQualifiedRoot( Tree identifier381 ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 
-    protected PathedPropertyReferenceSource normalizePropertyPathIntermediary( PathedPropertyReferenceSource source, CommonTree propertyName ) {
+    protected PathedPropertyReferenceSource normalizePropertyPathIntermediary( PathedPropertyReferenceSource source, Tree propertyName ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 
-    protected void normalizeIntermediateIndexOperation( CommonTree commonTree,
-			CommonTree commonTree2 ) {
+    protected void normalizeIntermediateIndexOperation( PathedPropertyReferenceSource propertyReferenceSource, Tree collectionProperty,
+			Tree selector ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 
+    protected void normalizeTerminalIndexOperation( PathedPropertyReferenceSource propertyReferenceSource, Tree collectionProperty,
+			Tree selector ) {
+        throw new UnsupportedOperationException( "must be overridden!" );
+    }
+
     protected PathedPropertyReferenceSource normalizeUnqualifiedPropertyReferenceSource(
-			CommonTree identifier394 ) {
+			Tree identifier394 ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 
-    protected void normalizeTerminalIndexOperation(CommonTree collectionPath, CommonTree selector) {
+    protected Tree normalizePropertyPathTerminus(PathedPropertyReferenceSource source, Tree propertyNameNode) {
         throw new UnsupportedOperationException( "must be overridden!" );
     }
 
-    protected Tree normalizePropertyPathTerminus(PathedPropertyReferenceSource source, CommonTree propertyNameNode) {
-        throw new UnsupportedOperationException( "must be overridden!" );
-    }
-
 	protected void pushFromStrategy( JoinType joinType,
-			CommonTree assosiationFetchTree, CommonTree propertyFetchTree,
-			CommonTree alias ) {
+			Tree assosiationFetchTree, Tree propertyFetchTree,
+			Tree alias ) {
         throw new UnsupportedOperationException( "must be overridden!" );
 	}
 	
@@ -595,18 +596,21 @@
 
 intermediateIndexOperation
 	:	^( LEFT_SQUARE indexOperationSource indexSelector ) 
-	{	normalizeIntermediateIndexOperation( $indexOperationSource.tree, $indexSelector.tree );	}
+	{	normalizeIntermediateIndexOperation( $indexOperationSource.propertyReferenceSource, $indexOperationSource.collectionProperty, $indexSelector.tree );	}
 	;
 
 terminalIndexOperation
 	:	^( LEFT_SQUARE indexOperationSource indexSelector ) 
-	{	normalizeTerminalIndexOperation( $indexOperationSource.tree, $indexSelector.tree );	}
+	{	normalizeTerminalIndexOperation( $indexOperationSource.propertyReferenceSource, $indexOperationSource.collectionProperty, $indexSelector.tree );	}
 	;
 
 indexOperationSource returns [PathedPropertyReferenceSource propertyReferenceSource, Tree collectionProperty]
 	:	^(DOT pathedPropertyReferenceSource IDENTIFIER )
+	{	$propertyReferenceSource = $pathedPropertyReferenceSource.propertyReferenceSource;
+		$collectionProperty = $IDENTIFIER;	}
     |	{(isUnqualifiedPropertyReference())}?=> IDENTIFIER
-    {	$propertyReferenceSource = normalizeUnqualifiedPropertyReferenceSource( $IDENTIFIER );	}
+    {	$propertyReferenceSource = normalizeUnqualifiedPropertyReferenceSource( $IDENTIFIER );
+    	$collectionProperty = $IDENTIFIER;	}
 	;
 
 indexSelector

Modified: core/branches/antlr3/src/main/java/org/hibernate/sql/ast/common/HibernateTree.java
===================================================================
--- core/branches/antlr3/src/main/java/org/hibernate/sql/ast/common/HibernateTree.java	2009-04-23 16:01:18 UTC (rev 16426)
+++ core/branches/antlr3/src/main/java/org/hibernate/sql/ast/common/HibernateTree.java	2009-04-23 16:12:38 UTC (rev 16427)
@@ -56,6 +56,11 @@
 		this.token = node.token;
 	}
 
+	public HibernateTree(CommonTree node) {
+		super(node);
+		this.token = node.token;
+	}
+
 	public HibernateTree(Token token) {
 		super(token);
 	}




More information about the hibernate-commits mailing list