org.modeshape.jcr.query
Class JcrSql2QueryParser

java.lang.Object
  extended by org.modeshape.graph.query.parse.SqlQueryParser
      extended by org.modeshape.jcr.query.JcrSql2QueryParser
All Implemented Interfaces:
QueryParser
Direct Known Subclasses:
JcrQomQueryParser

public class JcrSql2QueryParser
extends SqlQueryParser

An specialization of the SqlQueryParser that uses a different language name that matches the JCR 2.0 specification.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.modeshape.graph.query.parse.SqlQueryParser
SqlQueryParser.SqlTokenizer
 
Field Summary
static String LANGUAGE
           
 
Constructor Summary
JcrSql2QueryParser()
           
 
Method Summary
protected  JcrAnd and(Constraint constraint1, Constraint constraint2)
          
protected  JcrArithmeticOperand arithmeticOperand(DynamicOperand leftOperand, ArithmeticOperator operator, DynamicOperand rightOperand)
          
protected  Between between(DynamicOperand operand, StaticOperand lowerBound, StaticOperand upperBound, boolean lowerInclusive, boolean upperInclusive)
          
protected  JcrBindVariableName bindVariableName(String variableName)
          
protected  JcrChildNode childNode(SelectorName name, String path)
          
protected  JcrChildNodeJoinCondition childNodeJoinCondition(SelectorName parent, SelectorName child)
          
protected  JcrColumn column(SelectorName selectorName, String propertyName, String columnName)
           
protected  List<JcrColumn> columns(List<? extends Column> columns)
           
protected  JcrComparison comparison(DynamicOperand left, Operator operator, StaticOperand right)
          
protected  JcrDescendantNode descendantNode(SelectorName name, String path)
          
protected  JcrDescendantNodeJoinCondition descendantNodeJoinCondition(SelectorName ancestor, SelectorName descendant)
          
protected  JcrEquiJoinCondition equiJoinCondition(SelectorName selector1, String property1, SelectorName selector2, String property2)
          
protected  JcrFullTextSearch fullTextSearch(SelectorName name, String propertyName, String expression, FullTextSearch.Term term)
          
protected  JcrFullTextSearchScore fullTextSearchScore(SelectorName selector)
          
 String getLanguage()
          Get the name of the language that this parser is able to understand.
protected  JcrJoin join(Source left, JoinType joinType, Source right, JoinCondition joinCondition)
          
protected  Length length(PropertyValue propertyValue)
          
protected  JcrLimit limit(int rowCount, int offset)
          
protected  JcrLiteral literal(TypeSystem typeSystem, Object value)
          
protected  JcrLowerCase lowerCase(DynamicOperand operand)
          
protected  JcrNodeDepth nodeDepth(SelectorName selector)
          
protected  JcrNodeLocalName nodeLocalName(SelectorName selector)
          
protected  JcrNodeName nodeName(SelectorName selector)
          
protected  JcrNodePath nodePath(SelectorName selector)
          
protected  JcrNot not(Constraint constraint)
          
protected  JcrOr or(Constraint constraint1, Constraint constraint2)
          
protected  JcrOrdering ordering(DynamicOperand operand, Order order)
          
protected  List<JcrOrdering> orderings(List<? extends Ordering> orderings)
           
protected  JcrNamedSelector parseNamedSelector(TokenStream tokens, TypeSystem typeSystem)
           
protected  SetQuery parseSetQuery(TokenStream tokens, QueryCommand leftHandSide, TypeSystem typeSystem)
          
protected  JcrPropertyExistence propertyExistence(SelectorName selector, String propertyName)
          
protected  JcrPropertyValue propertyValue(SelectorName selector, String propertyName)
          
protected  JcrSelectQuery query(Source source, Constraint constraint, List<? extends Ordering> orderings, List<? extends Column> columns, Limit limit, boolean distinct)
          
protected  JcrReferenceValue referenceValue(SelectorName selector)
          
protected  JcrReferenceValue referenceValue(SelectorName selector, String propertyName)
          
protected  JcrSameNode sameNode(SelectorName name, String path)
          
protected  JcrSameNodeJoinCondition sameNodeJoinCondition(SelectorName selector1, SelectorName selector2)
          
protected  JcrSameNodeJoinCondition sameNodeJoinCondition(SelectorName selector1, SelectorName selector2, String path)
          
protected  SetCriteria setCriteria(DynamicOperand operand, Collection<? extends StaticOperand> values)
          
protected  JcrSetQuery setQuery(QueryCommand leftQuery, SetQuery.Operation operation, QueryCommand rightQuery, boolean all)
          
protected  Subquery subquery(QueryCommand queryCommand)
          
protected  JcrUpperCase upperCase(DynamicOperand operand)
          
 
Methods inherited from class org.modeshape.graph.query.parse.SqlQueryParser
equals, parseComparisonOperator, parseConstraint, parseDynamicOperand, parseFrom, parseFullTextSearchExpression, parseInClause, parseJoinCondition, parseLimit, parseLiteral, parseLiteralValue, parseName, parseName, parseOrderBy, parseOrdering, parsePath, parsePropertyExistance, parsePropertyValue, parseQuery, parseQuery, parseQueryCommand, parseReferenceValue, parseSelect, parseSelectorName, parseStaticOperand, parseWhere, removeBracketsAndQuotes, removeBracketsAndQuotes, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LANGUAGE

public static final String LANGUAGE
See Also:
Constant Field Values
Constructor Detail

JcrSql2QueryParser

public JcrSql2QueryParser()
Method Detail

getLanguage

public String getLanguage()
Get the name of the language that this parser is able to understand.

Specified by:
getLanguage in interface QueryParser
Overrides:
getLanguage in class SqlQueryParser
Returns:
the language name; never null
See Also:
QueryParser.getLanguage()

parseNamedSelector

protected JcrNamedSelector parseNamedSelector(TokenStream tokens,
                                              TypeSystem typeSystem)
Overrides:
parseNamedSelector in class SqlQueryParser

query

protected JcrSelectQuery query(Source source,
                               Constraint constraint,
                               List<? extends Ordering> orderings,
                               List<? extends Column> columns,
                               Limit limit,
                               boolean distinct)

Overrides:
query in class SqlQueryParser
See Also:
SqlQueryParser.query(org.modeshape.graph.query.model.Source, org.modeshape.graph.query.model.Constraint, java.util.List, java.util.List, org.modeshape.graph.query.model.Limit, boolean)

setQuery

protected JcrSetQuery setQuery(QueryCommand leftQuery,
                               SetQuery.Operation operation,
                               QueryCommand rightQuery,
                               boolean all)

Overrides:
setQuery in class SqlQueryParser
See Also:
SqlQueryParser.setQuery(org.modeshape.graph.query.model.QueryCommand, org.modeshape.graph.query.model.SetQuery.Operation, org.modeshape.graph.query.model.QueryCommand, boolean)

columns

protected List<JcrColumn> columns(List<? extends Column> columns)

orderings

protected List<JcrOrdering> orderings(List<? extends Ordering> orderings)

parseSetQuery

protected SetQuery parseSetQuery(TokenStream tokens,
                                 QueryCommand leftHandSide,
                                 TypeSystem typeSystem)

Overrides:
parseSetQuery in class SqlQueryParser
See Also:
SqlQueryParser.parseSetQuery(org.modeshape.common.text.TokenStream, org.modeshape.graph.query.model.QueryCommand, org.modeshape.graph.query.model.TypeSystem)

length

protected Length length(PropertyValue propertyValue)

Overrides:
length in class SqlQueryParser
See Also:
SqlQueryParser.length(org.modeshape.graph.query.model.PropertyValue)

lowerCase

protected JcrLowerCase lowerCase(DynamicOperand operand)

Overrides:
lowerCase in class SqlQueryParser
See Also:
SqlQueryParser.lowerCase(org.modeshape.graph.query.model.DynamicOperand)

upperCase

protected JcrUpperCase upperCase(DynamicOperand operand)

Overrides:
upperCase in class SqlQueryParser
See Also:
SqlQueryParser.upperCase(org.modeshape.graph.query.model.DynamicOperand)

nodeName

protected JcrNodeName nodeName(SelectorName selector)

Overrides:
nodeName in class SqlQueryParser
See Also:
SqlQueryParser.nodeName(org.modeshape.graph.query.model.SelectorName)

nodeLocalName

protected JcrNodeLocalName nodeLocalName(SelectorName selector)

Overrides:
nodeLocalName in class SqlQueryParser
See Also:
SqlQueryParser.nodeLocalName(org.modeshape.graph.query.model.SelectorName)

nodeDepth

protected JcrNodeDepth nodeDepth(SelectorName selector)

Overrides:
nodeDepth in class SqlQueryParser
See Also:
SqlQueryParser.nodeDepth(org.modeshape.graph.query.model.SelectorName)

nodePath

protected JcrNodePath nodePath(SelectorName selector)

Overrides:
nodePath in class SqlQueryParser
See Also:
SqlQueryParser.nodePath(org.modeshape.graph.query.model.SelectorName)

equiJoinCondition

protected JcrEquiJoinCondition equiJoinCondition(SelectorName selector1,
                                                 String property1,
                                                 SelectorName selector2,
                                                 String property2)

Overrides:
equiJoinCondition in class SqlQueryParser
See Also:
SqlQueryParser.equiJoinCondition(org.modeshape.graph.query.model.SelectorName, java.lang.String, org.modeshape.graph.query.model.SelectorName, java.lang.String)

descendantNodeJoinCondition

protected JcrDescendantNodeJoinCondition descendantNodeJoinCondition(SelectorName ancestor,
                                                                     SelectorName descendant)

Overrides:
descendantNodeJoinCondition in class SqlQueryParser
See Also:
SqlQueryParser.descendantNodeJoinCondition(org.modeshape.graph.query.model.SelectorName, org.modeshape.graph.query.model.SelectorName)

childNodeJoinCondition

protected JcrChildNodeJoinCondition childNodeJoinCondition(SelectorName parent,
                                                           SelectorName child)

Overrides:
childNodeJoinCondition in class SqlQueryParser
See Also:
SqlQueryParser.childNodeJoinCondition(org.modeshape.graph.query.model.SelectorName, org.modeshape.graph.query.model.SelectorName)

sameNodeJoinCondition

protected JcrSameNodeJoinCondition sameNodeJoinCondition(SelectorName selector1,
                                                         SelectorName selector2)

Overrides:
sameNodeJoinCondition in class SqlQueryParser
See Also:
SqlQueryParser.sameNodeJoinCondition(org.modeshape.graph.query.model.SelectorName, org.modeshape.graph.query.model.SelectorName)

sameNodeJoinCondition

protected JcrSameNodeJoinCondition sameNodeJoinCondition(SelectorName selector1,
                                                         SelectorName selector2,
                                                         String path)

Overrides:
sameNodeJoinCondition in class SqlQueryParser
See Also:
SqlQueryParser.sameNodeJoinCondition(org.modeshape.graph.query.model.SelectorName, org.modeshape.graph.query.model.SelectorName, java.lang.String)

limit

protected JcrLimit limit(int rowCount,
                         int offset)

Overrides:
limit in class SqlQueryParser
See Also:
SqlQueryParser.limit(int, int)

column

protected JcrColumn column(SelectorName selectorName,
                           String propertyName,
                           String columnName)
Overrides:
column in class SqlQueryParser

join

protected JcrJoin join(Source left,
                       JoinType joinType,
                       Source right,
                       JoinCondition joinCondition)

Overrides:
join in class SqlQueryParser
See Also:
SqlQueryParser.join(org.modeshape.graph.query.model.Source, org.modeshape.graph.query.model.JoinType, org.modeshape.graph.query.model.Source, org.modeshape.graph.query.model.JoinCondition)

not

protected JcrNot not(Constraint constraint)

Overrides:
not in class SqlQueryParser
See Also:
SqlQueryParser.not(org.modeshape.graph.query.model.Constraint)

and

protected JcrAnd and(Constraint constraint1,
                     Constraint constraint2)

Overrides:
and in class SqlQueryParser
See Also:
SqlQueryParser.and(org.modeshape.graph.query.model.Constraint, org.modeshape.graph.query.model.Constraint)

or

protected JcrOr or(Constraint constraint1,
                   Constraint constraint2)

Overrides:
or in class SqlQueryParser
See Also:
SqlQueryParser.or(org.modeshape.graph.query.model.Constraint, org.modeshape.graph.query.model.Constraint)

fullTextSearch

protected JcrFullTextSearch fullTextSearch(SelectorName name,
                                           String propertyName,
                                           String expression,
                                           FullTextSearch.Term term)

Overrides:
fullTextSearch in class SqlQueryParser
See Also:
SqlQueryParser.fullTextSearch(org.modeshape.graph.query.model.SelectorName, java.lang.String, java.lang.String, org.modeshape.graph.query.model.FullTextSearch.Term)

sameNode

protected JcrSameNode sameNode(SelectorName name,
                               String path)

Overrides:
sameNode in class SqlQueryParser
See Also:
SqlQueryParser.sameNode(org.modeshape.graph.query.model.SelectorName, java.lang.String)

childNode

protected JcrChildNode childNode(SelectorName name,
                                 String path)

Overrides:
childNode in class SqlQueryParser
See Also:
SqlQueryParser.childNode(org.modeshape.graph.query.model.SelectorName, java.lang.String)

descendantNode

protected JcrDescendantNode descendantNode(SelectorName name,
                                           String path)

Overrides:
descendantNode in class SqlQueryParser
See Also:
SqlQueryParser.descendantNode(org.modeshape.graph.query.model.SelectorName, java.lang.String)

comparison

protected JcrComparison comparison(DynamicOperand left,
                                   Operator operator,
                                   StaticOperand right)

Overrides:
comparison in class SqlQueryParser
See Also:
SqlQueryParser.comparison(org.modeshape.graph.query.model.DynamicOperand, org.modeshape.graph.query.model.Operator, org.modeshape.graph.query.model.StaticOperand)

ordering

protected JcrOrdering ordering(DynamicOperand operand,
                               Order order)

Overrides:
ordering in class SqlQueryParser
See Also:
SqlQueryParser.ordering(org.modeshape.graph.query.model.DynamicOperand, org.modeshape.graph.query.model.Order)

propertyExistence

protected JcrPropertyExistence propertyExistence(SelectorName selector,
                                                 String propertyName)

Overrides:
propertyExistence in class SqlQueryParser
See Also:
SqlQueryParser.propertyExistence(org.modeshape.graph.query.model.SelectorName, java.lang.String)

fullTextSearchScore

protected JcrFullTextSearchScore fullTextSearchScore(SelectorName selector)

Overrides:
fullTextSearchScore in class SqlQueryParser
See Also:
SqlQueryParser.fullTextSearchScore(org.modeshape.graph.query.model.SelectorName)

between

protected Between between(DynamicOperand operand,
                          StaticOperand lowerBound,
                          StaticOperand upperBound,
                          boolean lowerInclusive,
                          boolean upperInclusive)

Overrides:
between in class SqlQueryParser
See Also:
SqlQueryParser.between(org.modeshape.graph.query.model.DynamicOperand, org.modeshape.graph.query.model.StaticOperand, org.modeshape.graph.query.model.StaticOperand, boolean, boolean)

setCriteria

protected SetCriteria setCriteria(DynamicOperand operand,
                                  Collection<? extends StaticOperand> values)

Overrides:
setCriteria in class SqlQueryParser
See Also:
SqlQueryParser.setCriteria(org.modeshape.graph.query.model.DynamicOperand, java.util.Collection)

arithmeticOperand

protected JcrArithmeticOperand arithmeticOperand(DynamicOperand leftOperand,
                                                 ArithmeticOperator operator,
                                                 DynamicOperand rightOperand)

Overrides:
arithmeticOperand in class SqlQueryParser
See Also:
SqlQueryParser.arithmeticOperand(org.modeshape.graph.query.model.DynamicOperand, org.modeshape.graph.query.model.ArithmeticOperator, org.modeshape.graph.query.model.DynamicOperand)

propertyValue

protected JcrPropertyValue propertyValue(SelectorName selector,
                                         String propertyName)

Overrides:
propertyValue in class SqlQueryParser
See Also:
SqlQueryParser.propertyValue(org.modeshape.graph.query.model.SelectorName, java.lang.String)

referenceValue

protected JcrReferenceValue referenceValue(SelectorName selector)

Overrides:
referenceValue in class SqlQueryParser
See Also:
SqlQueryParser.referenceValue(org.modeshape.graph.query.model.SelectorName)

referenceValue

protected JcrReferenceValue referenceValue(SelectorName selector,
                                           String propertyName)

Overrides:
referenceValue in class SqlQueryParser
See Also:
SqlQueryParser.referenceValue(org.modeshape.graph.query.model.SelectorName, java.lang.String)

bindVariableName

protected JcrBindVariableName bindVariableName(String variableName)

Overrides:
bindVariableName in class SqlQueryParser
See Also:
SqlQueryParser.bindVariableName(java.lang.String)

subquery

protected Subquery subquery(QueryCommand queryCommand)

Overrides:
subquery in class SqlQueryParser
See Also:
SqlQueryParser.subquery(org.modeshape.graph.query.model.QueryCommand)

literal

protected JcrLiteral literal(TypeSystem typeSystem,
                             Object value)
                      throws ValueFormatException

Overrides:
literal in class SqlQueryParser
Throws:
ValueFormatException
See Also:
SqlQueryParser.literal(TypeSystem, Object)


Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.