use of org.apache.jackrabbit.oak.query.ast.NodeTypeInfo in project jackrabbit-oak by apache.
the class NodeTypeIndexTest method createFilter.
private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(root);
NodeTypeInfo type = nodeTypes.getNodeTypeInfo(nodeTypeName);
SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
}
use of org.apache.jackrabbit.oak.query.ast.NodeTypeInfo in project jackrabbit-oak by apache.
the class IndexUpdateTest method find.
private Set<String> find(PropertyIndexLookup lookup, String name, String value) {
NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(root);
NodeTypeInfo type = nodeTypes.getNodeTypeInfo(NT_BASE);
SelectorImpl selector = new SelectorImpl(type, NT_BASE);
Filter filter = new FilterImpl(selector, "SELECT * FROM [nt:base]", new QueryEngineSettings());
return Sets.newHashSet(lookup.query(filter, name, PropertyValues.newString(value)));
}
use of org.apache.jackrabbit.oak.query.ast.NodeTypeInfo in project jackrabbit-oak by apache.
the class SQL2Parser method parseSelector.
private SelectorImpl parseSelector() throws ParseException {
String nodeTypeName = readName();
if (namePathMapper != null) {
try {
nodeTypeName = namePathMapper.getOakName(nodeTypeName);
} catch (RepositoryException e) {
ParseException e2 = getSyntaxError("could not convert node type name " + nodeTypeName);
e2.initCause(e);
throw e2;
}
}
NodeTypeInfo nodeTypeInfo = nodeTypes.getNodeTypeInfo(nodeTypeName);
if (!nodeTypeInfo.exists()) {
throw getSyntaxError("unknown node type");
}
String selectorName = nodeTypeName;
if (readIf("AS")) {
selectorName = readName();
}
return factory.selector(nodeTypeInfo, selectorName);
}
use of org.apache.jackrabbit.oak.query.ast.NodeTypeInfo in project jackrabbit-oak by apache.
the class ReferenceIndexTest method createFilter.
@SuppressWarnings("Duplicates")
private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(root);
NodeTypeInfo type = nodeTypes.getNodeTypeInfo(nodeTypeName);
SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
}
use of org.apache.jackrabbit.oak.query.ast.NodeTypeInfo in project jackrabbit-oak by apache.
the class IndexPathServiceImpl method createFilter.
private FilterImpl createFilter(String nodeTypeName) {
NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(nodeStore.getRoot());
NodeTypeInfo type = nodeTypes.getNodeTypeInfo(nodeTypeName);
SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", settings);
}
Aggregations