org.priha.query
Class SimpleQueryProvider

java.lang.Object
  extended by org.priha.query.aqt.DefaultQueryNodeVisitor
      extended by org.priha.query.aqt.TraversingQueryNodeVisitor
          extended by org.priha.query.SimpleQueryProvider
All Implemented Interfaces:
QueryNodeVisitor, QueryProvider

public class SimpleQueryProvider
extends TraversingQueryNodeVisitor
implements QueryProvider

This class provides a very simple query provider which does direct comparisons against the contents of the repository. The upside is that this makes it very simple; with the obvious downside that this is really slow because it traverses the entire repository one matched Node at a time.

Author:
Janne Jalkanen

Constructor Summary
SimpleQueryProvider()
           
 
Method Summary
 javax.jcr.query.QueryResult query(SessionImpl session, QueryRootNode root)
           
 java.lang.Object visit(AndQueryNode node, java.lang.Object data)
           
 java.lang.Object visit(LocationStepQueryNode node, java.lang.Object data)
           
 java.lang.Object visit(NodeTypeQueryNode node, java.lang.Object data)
          //element(*,"nt:base")
 java.lang.Object visit(OrderQueryNode node, java.lang.Object data)
           
 java.lang.Object visit(PathQueryNode node, java.lang.Object data)
           
 java.lang.Object visit(RelationQueryNode node, java.lang.Object data)
           
 java.lang.Object visit(TextsearchQueryNode node, java.lang.Object data)
           
 
Methods inherited from class org.priha.query.aqt.TraversingQueryNodeVisitor
visit, visit, visit, visit
 
Methods inherited from class org.priha.query.aqt.DefaultQueryNodeVisitor
visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleQueryProvider

public SimpleQueryProvider()
Method Detail

query

public javax.jcr.query.QueryResult query(SessionImpl session,
                                         QueryRootNode root)
                                  throws javax.jcr.RepositoryException
Specified by:
query in interface QueryProvider
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(AndQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class TraversingQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(OrderQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class DefaultQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(PathQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class TraversingQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(RelationQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class DefaultQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(LocationStepQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class TraversingQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(TextsearchQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class DefaultQueryNodeVisitor
Throws:
javax.jcr.RepositoryException

visit

public java.lang.Object visit(NodeTypeQueryNode node,
                              java.lang.Object data)
                       throws javax.jcr.RepositoryException
//element(*,"nt:base")

Specified by:
visit in interface QueryNodeVisitor
Overrides:
visit in class DefaultQueryNodeVisitor
Throws:
javax.jcr.RepositoryException