> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Michiel Meeuwissen
> Verzonden: donderdag 21 oktober 2004 16:19
> Aan: [EMAIL PROTECTED]
> Onderwerp: Re: Fetching relations from the MMBase cloud
> 
> Ronald Wildenberg wrote:
> > Thanks, this is a good solution I think. I'll try it.
> > 
> > The final solution I came up with is:
> > 
> > Query query = cloud.createNodeQuery(); 
> > query.addStep(cloud.getNodeManager("A"));
> > query.addRelationStep(cloud.getNodeManager("A"), "related", 
> > "destination"); cloud.getList(query);
> > 
> > This is more or less the same as you suggest and indeed has the 
> > disadvantage that every relation that needs to be obtained results
in 
> > another database call. Putting relation numbers in a single
constraint 
> > is a good way to solve this.
> 
> Is it not possible to set the 'step' to the relation? With 
> Node.setNodeStep(), and the the query must be executed on the 
> right nodemanager.


I assume you mean NodeQuery.setNodeStep?

This is the first time I use the Query interface, so I do not completely
understand what you mean. What exactly does setNodeStep do? The JavaDoc
does not really tell me what will happen.


> 
> This is the way use by the several node-lists implementations 
> to avoid a query for every node. I'm not sure if the 'node' 
> step also may be the relation step itself, but you could try it.
> 
> 
> Bbtw, i looked at Queries#getRelationNodesQuery:
> 
>  public static NodeQuery createRelationNodesQuery(Node node, 
> NodeManager otherNodeManager, String role, String direction) {
>         NodeQuery query = createNodeQuery(node);
>         if (otherNodeManager == null) otherNodeManager = 
> node.getCloud().getNodeManager("object");
>         RelationStep step = 
> query.addRelationStep(otherNodeManager, role, direction);
>         query.setNodeStep(step);
>         return query;
>     }
> 
> which makes me think, that it is possible.


If I read this code and the JavaDoc correctly this code assumes a
starting node to be present. I do not have a starting node in my case. I
just wish to retrieve all relation nodes between two node types.


> 
> Michiel
> 

Ronald



-----------------------Disclaimer-------------------------
Dit bericht (met bijlagen) is met grote zorgvuldigheid samengesteld. Voor mogelijke 
onjuistheid en/of onvolledigheid van de hierin verstrekte informatie kan Kennisnet 
geen aansprakelijkheid aanvaarden, evenmin kunnen aan de inhoud van dit bericht (met 
bijlagen) rechten worden ontleend. De inhoud van dit bericht (met bijlagen) kan 
vertrouwelijke informatie bevatten en is uitsluitend bestemd voor de geadresseerde van 
dit bericht. Indien u niet de beoogde ontvanger van dit bericht bent, verzoekt 
Kennisnet u dit bericht te verwijderen, eventuele bijlagen niet te openen en wijst 
Kennisnet u op de onrechtmatigheid van het gebruiken, kopi�ren of verspreiden van de 
inhoud van dit bericht (met bijlagen).

This message (with attachments) is given in good faith. Kennisnet cannot assume any 
responsibility for the accuracy or reliability of the information contained in this 
message (with attachments), nor shall the information be construed as constituting any 
obligation on the part of Kennisnet. The information contained in this message (with 
attachments) may be confidential or privileged and is only intended for the use of the 
named addressee. If you are not the intended recipient, you are requested by Kennisnet 
to delete this message (with attachments) without opening it and you are notified by 
Kennisnet that any disclosure, copying or distribution of the information contained in 
this message (with attachments) is strictly prohibited and unlawful.
----------------------------------------------------------


Reply via email to