org.apache.olingo.odata2.jpa.processor.core
Class ODataExpressionParser

java.lang.Object
  extended by org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser

public class ODataExpressionParser
extends Object

This class contains utility methods for parsing the filter expressions built by core library from user OData Query.


Field Summary
static String EMPTY
           
static Integer methodFlag
           
 
Constructor Summary
ODataExpressionParser()
           
 
Method Summary
static String parseKeyPredicates(List<KeyPredicate> keyPredicates, String tableAlias)
          This method evaluated the where expression for read of an entity based on the keys specified in the query.
static HashMap<String,String> parseKeyPropertiesToJPAOrderByExpression(List<EdmProperty> edmPropertylist, String tableAlias)
           
static HashMap<String,String> parseToJPAOrderByExpression(OrderByExpression orderByExpression, String tableAlias)
          This method parses the order by condition in the query.
static String parseToJPASelectExpression(String tableAlias, ArrayList<String> selectedFields)
          This method parses the select clause
static String parseToJPAWhereExpression(CommonExpression whereExpression, String tableAlias)
          This method returns the parsed where condition corresponding to the filter input in the user query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final String EMPTY
See Also:
Constant Field Values

methodFlag

public static Integer methodFlag
Constructor Detail

ODataExpressionParser

public ODataExpressionParser()
Method Detail

parseToJPAWhereExpression

public static String parseToJPAWhereExpression(CommonExpression whereExpression,
                                               String tableAlias)
                                        throws ODataException
This method returns the parsed where condition corresponding to the filter input in the user query.

Parameters:
whereExpression -
Returns:
Parsed where condition String
Throws:
ODataException

parseToJPASelectExpression

public static String parseToJPASelectExpression(String tableAlias,
                                                ArrayList<String> selectedFields)
This method parses the select clause

Parameters:
tableAlias -
selectedFields -
Returns:
a select expression

parseToJPAOrderByExpression

public static HashMap<String,String> parseToJPAOrderByExpression(OrderByExpression orderByExpression,
                                                                 String tableAlias)
                                                          throws ODataJPARuntimeException
This method parses the order by condition in the query.

Parameters:
orderByExpression -
Returns:
a map of JPA attributes and their sort order
Throws:
ODataJPARuntimeException

parseKeyPredicates

public static String parseKeyPredicates(List<KeyPredicate> keyPredicates,
                                        String tableAlias)
                                 throws ODataJPARuntimeException
This method evaluated the where expression for read of an entity based on the keys specified in the query.

Parameters:
keyPredicates -
Returns:
the evaluated where expression
Throws:
ODataJPARuntimeException

parseKeyPropertiesToJPAOrderByExpression

public static HashMap<String,String> parseKeyPropertiesToJPAOrderByExpression(List<EdmProperty> edmPropertylist,
                                                                              String tableAlias)
                                                                       throws ODataJPARuntimeException
Throws:
ODataJPARuntimeException


Copyright © 2013-2014 The Apache Software Foundation. All Rights Reserved.