Class DefaultSQLQueryBuilder

java.lang.Object
com.j_spaces.sadapter.datasource.DefaultSQLQueryBuilder
All Implemented Interfaces:
SQLQueryBuilder

public class DefaultSQLQueryBuilder extends Object implements SQLQueryBuilder
Default implementation for building the SQLQuery.
Author:
anna
  • Field Details

  • Constructor Details

    • DefaultSQLQueryBuilder

      public DefaultSQLQueryBuilder()
  • Method Details

    • build

      public SQLQuery<?> build(ITemplateHolder template, String typeName, ITypeDesc typeDesc)
      Builds the SQLQuery using given template extended match codes and values.
      Specified by:
      build in interface SQLQueryBuilder
      Parameters:
      typeName - the query is built using the provided typeName incase the template represents a null template or there's no type.
      typeDesc - might be null in case the space didn't introduce this type (might happen in case of inheritance)
      Returns:
      SQLQuery
    • convertToSQLFormat

      public static Object convertToSQLFormat(Object object, short matchCode)
      Returns:
      Object that was converted to SQL format
    • build

      public SQLQuery<?> build(IEntryPacket entry, ITypeDesc typeDesc)
      Description copied from interface: SQLQueryBuilder
      Builds an SQLQuery from given entry packet
      Specified by:
      build in interface SQLQueryBuilder
      Returns:
      SQLQuery
    • mapCodeToSign

      public static String mapCodeToSign(short code)
      Maps between extended match-codes to actual SQL Query sign.
      Parameters:
      code - the extended match-code to map
      Returns:
      the corresponding SQL Query sign (according to extendedMatchCodeMapping)