also try to handle groupby nodes in getProperty
This commit is contained in:
		
							parent
							
								
									4010beb3de
								
							
						
					
					
						commit
						80efd3f5e1
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -1116,6 +1116,7 @@ public class Node implements INode, Serializable { | ||||||
| 	return subnodes.indexOf (node.getHandle ()); | 	return subnodes.indexOf (node.getHandle ()); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Count the subnodes of this node. If they're stored in a relational data source, we |      * Count the subnodes of this node. If they're stored in a relational data source, we | ||||||
|      * may actually load their IDs in order to do this. |      * may actually load their IDs in order to do this. | ||||||
|  | @ -1249,6 +1250,7 @@ public class Node implements INode, Serializable { | ||||||
| 	// either because it is mapped from a relational database or defined as virtual node | 	// either because it is mapped from a relational database or defined as virtual node | ||||||
| 	if (prop == null && dbmap != null) { | 	if (prop == null && dbmap != null) { | ||||||
| 	    Relation prel =  dbmap.getPropertyRelation (propname); | 	    Relation prel =  dbmap.getPropertyRelation (propname); | ||||||
|  | 	    Relation srel = dbmap.getSubnodeRelation (); | ||||||
| 	    /* if (prel != null && prel.virtual && prel.other != null &&  !prel.other.isRelational ()) { | 	    /* if (prel != null && prel.virtual && prel.other != null &&  !prel.other.isRelational ()) { | ||||||
| 	        Node pn = (Node) createNode (propname); | 	        Node pn = (Node) createNode (propname); | ||||||
| 	        if (prel.prototype != null) { | 	        if (prel.prototype != null) { | ||||||
|  | @ -1257,9 +1259,11 @@ public class Node implements INode, Serializable { | ||||||
| 	        prop =  (Property) propMap.get (propname); | 	        prop =  (Property) propMap.get (propname); | ||||||
| 
 | 
 | ||||||
| 	    } else { */ | 	    } else { */ | ||||||
|  | 	        if (prel == null && srel != null && srel.groupby != null) | ||||||
|  | 	            prel = srel; | ||||||
| 	        if (prel == null) | 	        if (prel == null) | ||||||
| 	            prel = dbmap.getPropertyRelation (); | 	            prel = dbmap.getPropertyRelation (); | ||||||
| 	        if (prel != null && (prel.direction == Relation.DIRECT || prel.virtual)) { | 	        if (prel != null && (prel.direction == Relation.DIRECT || prel.virtual || prel.groupby != null)) { | ||||||
| 	            // this may be a relational node stored by property name | 	            // this may be a relational node stored by property name | ||||||
| 	            try { | 	            try { | ||||||
| 	                Node pn = nmgr.getNode (this, propname, prel); | 	                Node pn = nmgr.getNode (this, propname, prel); | ||||||
|  | @ -1771,3 +1775,4 @@ public class Node implements INode, Serializable { | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue