Of (query directive)

From WandoraWiki
Jump to: navigation, search

Contents

Description

Changes the active column of input to the specified column.

Constructor

Of(String role)

Notes

This directive is best used using the of method present in every directive. Calling A.of("role") will resolve to A.from(new Of("role")) which resolves to new From(A,new Of("role")). Usually this is followed by a call to from method, for example A.of("role").from(B). This will take results from B, change the active column and then feed them to A. Call to of must be before from to get the expected results.

Examples

1 importPackage(org.wandora.query2);
2 new Join(
3   new BaseName().of("#input").as("#inputbn"),
4   new BaseName().of("#instance").as("#instancebn")
5 ).from(
6   new Instances().as("#instance").from(
7     new As("#input"))
8 )

The of method call on line 3 is necessary because the active column is "#instance" from line 6. On line 4 it is not necessary but it makes the whole query more readable.

Personal tools