Class CypherParser
- java.lang.Object
-
- org.neotropic.kuwaiba.core.persistence.reference.neo4j.CypherParser
-
public class CypherParser extends Object
Cypher parser- Author:
- Adrian Martinez Molina <adrian.martinez@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description CypherParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateInstanceMatch(boolean isAbstract)creates the match when is only joinsStringcreateInstanceWhere(String className, boolean isAbstract)StringcreateJoinRelation(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.StringcreateJoinWhere(int condition, String joinName, String attributeName, String attributeValue, String attibuteType)Creates a where statement for joinsStringcreateListypeMatch(String listTypeName, String listTypeName2)add every listType into de the match a listType for every joinStringcreateListypeParentMatch(String listTypeName, String listTypeName2)Add this to the match for the parent and the parent joinsStringcreateNoneWhere(String listTypeName)if has no relationshipStringcreateParentMatch()Adds the match when the query has parentStringcreateParentRelation(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.StringcreateParentWhere(int condition, String joinName, String attributeName, String attributeValue, String attibuteType)Creates the where statement if there is a parentStringcreateReturn()creates the main return the "instance"StringcreateWhere(int condition, String attributeName, String attributeValue, String attibuteType)Simple where without joins or parent in the queryStringgetOperator(int condition)Get the operator as a string
-
-
-
Method Detail
-
createInstanceMatch
public String createInstanceMatch(boolean isAbstract)
creates the match when is only joins- Parameters:
isAbstract-- Returns:
-
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:
-
-