com.semarchy.mdm.runtime.semql.column.sqlgen
Class SemQLToSQLSimpleConverter

java.lang.Object
  extended by com.semarchy.mdm.runtime.semql.column.sqlgen.SemQLToSQLSimpleConverter

public class SemQLToSQLSimpleConverter
extends Object

Simple converter class mainly used by integration templates to translate a SemQL expressions and condition to SQL expressions and Conditions.

This class is not intended to supported nested attributes navigation such as the one implemented for data access

Author:
sarod

Constructor Summary
SemQLToSQLSimpleConverter(com.semarchy.platform.language.semql.attributes.ISemQLAttrProvider pAttrProvider, com.semarchy.platform.language.semql.functions.IFunctionProvider pFunctionProvider)
          Creates the converter from a
 
Method Summary
 String convertCond(String pSemQLExpr, Map<String,String> pAliasMap)
          Converts a semQL valid condition as defined by ICondition in semQL into a SQL expression using the alias map for remapping first level attributes of the attribute provider into the alias provided.
 String convertCond(String pSemQLExpr, String pAlias)
          Converts a semQL valid condition as defined by ICondition in semQL into a SQL expression using the alias as a prefix for all attributes of the attribute provider
 String convertExpr(String pSemQLExpr, Map<String,String> pAliasMap)
          Converts a semQL valid expression as defined by IExpression in semQL into a SQL expression using the alias map for remapping first level attributes of the attribute provider into the alias provided.
 String convertExpr(String pSemQLExpr, String pAlias)
          Converts a semQL valid expression as defined by IExpression in semQL into a SQL expression using the alias as a prefix for all attributes of the attribute provider
 String convertOrderByList(String pOrderByList, String pAlias)
          Converts a semQL valid order by expression into a SQL expression using the alias as a prefix for all attributes of the attribute provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemQLToSQLSimpleConverter

public SemQLToSQLSimpleConverter(com.semarchy.platform.language.semql.attributes.ISemQLAttrProvider pAttrProvider,
                                 com.semarchy.platform.language.semql.functions.IFunctionProvider pFunctionProvider)
Creates the converter from a

Parameters:
pAttrProvider -
Method Detail

convertExpr

public String convertExpr(String pSemQLExpr,
                          String pAlias)
Converts a semQL valid expression as defined by IExpression in semQL into a SQL expression using the alias as a prefix for all attributes of the attribute provider

Parameters:
pSemQLExpr -
pAlias -
Returns:
TODO

convertOrderByList

public String convertOrderByList(String pOrderByList,
                                 String pAlias)
Converts a semQL valid order by expression into a SQL expression using the alias as a prefix for all attributes of the attribute provider

Parameters:
pSemQLExpr -
pAlias -
Returns:
TODO

convertExpr

public String convertExpr(String pSemQLExpr,
                          Map<String,String> pAliasMap)
Converts a semQL valid expression as defined by IExpression in semQL into a SQL expression using the alias map for remapping first level attributes of the attribute provider into the alias provided.

Example:

 Attribute provider has: 
  + attr1
    + attr2
      + attr3 (X1)
      + attr4 (X2)
    + attr5
  + attr6
    + attr7 (X3)
 
 Sending alias map as {"attr1": "P", "attr6": "Z"}
 
 Results into:
 P.X1, P.X2, Z.X3
 

Parameters:
pSemQLExpr -
pAliasMap -
Returns:

convertCond

public String convertCond(String pSemQLExpr,
                          String pAlias)
Converts a semQL valid condition as defined by ICondition in semQL into a SQL expression using the alias as a prefix for all attributes of the attribute provider

Parameters:
pSemQLExpr -
pAlias -
Returns:
TODO

convertCond

public String convertCond(String pSemQLExpr,
                          Map<String,String> pAliasMap)
Converts a semQL valid condition as defined by ICondition in semQL into a SQL expression using the alias map for remapping first level attributes of the attribute provider into the alias provided.

Example:

 Attribute provider has: 
  + attr1
    + attr2
      + attr3 (X1)
      + attr4 (X2)
    + attr5
  + attr6
    + attr7 (X3)
 
 Sending alias map as {"attr1": "P", "attr6": "Z"}
 
 Results into:
 P.X1, P.X2, Z.X3
 

Parameters:
pSemQLExpr -
pAliasMap -
Returns:


Copyright © 2015. All Rights Reserved.