Class SqlToCypherConfig

java.lang.Object
org.neo4j.jdbc.translator.impl.SqlToCypherConfig

public final class SqlToCypherConfig extends Object
Configuration for the SqlToCypher, use this to configure parsing and rendering settings as well as table to node mappings.
Author:
Michael Hunger, Michael J. Simons
  • Field Details

    • PROPERTY_ALWAYS_ESCAPE_NAMES

      public static final String PROPERTY_ALWAYS_ESCAPE_NAMES
      A constant property name to make the translator always escape literal names.
      See Also:
    • PROPERTY_PRETTY_PRINT_CYPHER

      public static final String PROPERTY_PRETTY_PRINT_CYPHER
      A constant property name for enabling pretty formatted Cypher statements.
      See Also:
    • PROPERTY_ENABLE_CACHE

      public static final String PROPERTY_ENABLE_CACHE
      A constant property name for enabling the local translator cache.
      See Also:
  • Method Details

    • of

      public static SqlToCypherConfig of(Map<String,?> config)
      Derives a configuration for Sql2Cypher based from the properties given.
      Parameters:
      config - will be searched for values under keys prefixed with s2c.
      Returns:
      a new configuration object or the default config if there are no matching properties.
    • builder

      public static SqlToCypherConfig.Builder builder()
      A builder for creating new configuration objects.
      Returns:
      a new builder for creating a new configuration from scratch.
    • defaultConfig

      public static SqlToCypherConfig defaultConfig()
      Provides access to the default configuration.
      Returns:
      the default configuration ready to use.
    • modify

      public SqlToCypherConfig.Builder modify()
      Allows modifying this configuration.
      Returns:
      builder with all settings from this instance
    • getParseNameCase

      public org.jooq.conf.ParseNameCase getParseNameCase()
      Returns the case in which names are parsed.
      Returns:
      the case in which names are parsed
    • getRenderNameCase

      public org.jooq.conf.RenderNameCase getRenderNameCase()
      Returns the case in which names are rendered.
      Returns:
      the case in which names are rendered
    • isJooqDiagnosticLogging

      public boolean isJooqDiagnosticLogging()
      Returns whether jOOQ diagnostic logging is enabled.
      Returns:
      whether jOOQ diagnostic logging is enabled
    • getTableToLabelMappings

      public Map<String,String> getTableToLabelMappings()
      Returns the mapping from table names to labels.
      Returns:
      the mapping from table names to labels
    • getJoinColumnsToTypeMappings

      public Map<String,String> getJoinColumnsToTypeMappings()
      Returns the mapping from join columns to relationship types.
      Returns:
      the mapping from join columns to relationship types
    • getSqlDialect

      public org.jooq.SQLDialect getSqlDialect()
      Returns the configured SQL dialect for parsing.
      Returns:
      the configured SQL dialect for parsing
    • isPrettyPrint

      public boolean isPrettyPrint()
      Returns whether pretty printing of Cypher statements is enabled or not.
      Returns:
      whether pretty printing of Cypher statements is enabled or not
    • isAlwaysEscapeNames

      public boolean isAlwaysEscapeNames()
      Returns whether Cypher names are always escapd or not.
      Returns:
      whether Cypher names are always escapd or not
    • getParseNamedParamPrefix

      public String getParseNamedParamPrefix()
      Returns the prefixed that is recognized when parsing named parameters.
      Returns:
      the prefixed that is recognized when parsing named parameters
    • isCacheEnabled

      public boolean isCacheEnabled()
      Returns whether the internal cache is enabled or not.
      Returns:
      whether the internal cache is enabled or not
    • getPrecedence

      public Integer getPrecedence()
      Returns the precedence of the translator.
      Returns:
      the precedence of the translator
    • asSettings

      public org.jooq.conf.Settings asSettings()
    • asSettings

      public org.jooq.conf.Settings asSettings(org.jooq.conf.ParseWithMetaLookups withMetaLookups)