Class CypherParser


  • public class CypherParser
    extends Object
    Cypher parser
    Author:
    Adrian Martinez Molina <adrian.martinez@kuwaiba.org>
    • Constructor Detail

      • CypherParser

        public CypherParser()
    • Method Detail

      • createInstanceMatch

        public String createInstanceMatch​(boolean isAbstract)
        creates the match when is only joins
        Parameters:
        isAbstract -
        Returns:
      • createInstanceWhere

        public String createInstanceWhere​(String className,
                                          boolean isAbstract)
      • createParentMatch

        public String createParentMatch()
        Adds the match when the query has parent
        Returns:
      • createListypeMatch

        public String createListypeMatch​(String listTypeName,
                                         String listTypeName2)
        add every listType into de the match a listType for every join
        Parameters:
        listTypeName -
        listTypeName2 -
        Returns:
      • createNoneWhere

        public String createNoneWhere​(String listTypeName)
        if has no relationship
        Parameters:
        listTypeName -
        Returns:
      • createListypeParentMatch

        public String createListypeParentMatch​(String listTypeName,
                                               String listTypeName2)
        Add this to the match for the parent and the parent joins
        Parameters:
        listTypeName -
        listTypeName2 -
        Returns:
      • createWhere

        public String createWhere​(int condition,
                                  String attributeName,
                                  String attributeValue,
                                  String attibuteType)
        Simple where without joins or parent in the query
        Parameters:
        condition -
        attributeName -
        attributeValue -
        attibuteType -
        Returns:
        simple where statement
      • createJoinRelation

        public String createJoinRelation​(String joinName)
        every time a list type for a join or a parent or a parent join is added there must be a relation to identify every list type.
        Parameters:
        joinName -
        Returns:
      • createJoinWhere

        public String createJoinWhere​(int condition,
                                      String joinName,
                                      String attributeName,
                                      String attributeValue,
                                      String attibuteType)
        Creates a where statement for joins
        Parameters:
        condition -
        joinName -
        attributeName -
        attributeValue -
        attibuteType -
        Returns:
        where join statement
      • createParentRelation

        public String createParentRelation​(String joinName)
        every time a list type for a join or a parent or a parent join is added there must be a relation to identify every list type.
        Parameters:
        joinName -
        Returns:
      • createParentWhere

        public String createParentWhere​(int condition,
                                        String joinName,
                                        String attributeName,
                                        String attributeValue,
                                        String attibuteType)
        Creates the where statement if there is a parent
        Parameters:
        condition -
        joinName -
        attributeName -
        attributeValue -
        attibuteType -
        Returns:
        parent where statement
      • getOperator

        public String getOperator​(int condition)
        Get the operator as a string
        Parameters:
        condition -
        Returns:
        the operator as a string
      • createReturn

        public String createReturn()
        creates the main return the "instance"
        Returns: