Class DatabasePlatformBehavior

java.lang.Object
com.broadleafcommerce.enterprise.workflow.dao.simple.DatabasePlatformBehavior
All Implemented Interfaces:
org.springframework.core.Ordered
Direct Known Subclasses:
HSQLDatabasePlatformBehavior, MySQLDatabasePlatformBehavior, PostgresDatabasePlatformBehavior, SQLServerDatabasePlatformBehavior

public class DatabasePlatformBehavior extends Object implements org.springframework.core.Ordered
Denote special behavior per database platform required for support of the simple sandbox lifecycle strategy. See SimplePromotionStrategy.
Author:
Jeff Fischer
  • Constructor Details

    • DatabasePlatformBehavior

      public DatabasePlatformBehavior(String dialectName, Boolean requiresLowerCaseTableName, String safeStringPattern, String timestampPattern, Boolean integerBooleanRepresentation)
      Parameters:
      dialectName - Fully qualified classname of the Hibernate dialect
      requiresLowerCaseTableName - Whether or not the platform requires table names to be specified using lower case
      safeStringPattern - Database platform specific command to convert from a hexidecimal version of a string
      timestampPattern - Database platform specific command to convert from a UNIX epoch timestamp
      integerBooleanRepresentation - Whether or not the Hibernate dialect for the database platform supports booleans as an integer column
  • Method Details

    • getRequiresLowerCaseTableName

      public Boolean getRequiresLowerCaseTableName()
      Whether or not the platform requires table names to be specified using lower case (e.g. Postgres)
      Returns:
      Whether or not the platform requires table names to be specified using lower case
    • getSafeStringPattern

      public String getSafeStringPattern()
      Database platform specific command to convert from a hexidecimal version of a string into a standard string character representation. For example "UNHEX('%s')" for MySQL.
      Returns:
      Database platform specific command to convert from a hexidecimal version of a string
    • getTimestampPattern

      public String getTimestampPattern()
      Database platform specific command to convert from a date/time string SQL parameter into a timestamp representation. For example, "TO_TIMESTAMP('%s', 'YYYY.MM.DD HH:MI:SS)" for Oracle.
      Returns:
      Database platform specific command to convert from a UNIX epoch timestamp
    • getFalseBooleanRepresentation

      public Object getFalseBooleanRepresentation()
      Database platform specific representation of a false boolean. This is either '0', or boolean 'FALSE', depending on how the Hibernate dialect supports booleans on the platform.
      Returns:
      Database platform specific representation of a false boolean
    • getTrueBooleanRepresentation

      public Object getTrueBooleanRepresentation()
      Database platform specific representation of a true boolean. This is either '1', or boolean 'TRUE', depending on how the Hibernate dialect supports booleans on the platform.
      Returns:
      Database platform specific representation of a true boolean
    • getDialectName

      public String getDialectName()
      Fully qualified classname of the Hibernate dialect used to support the target database platform.
      Returns:
      Fully qualified classname of the Hibernate dialect
    • convertTimestamp

      public String convertTimestamp(String formattedDate)
      Performs a string conversion based on the behavior timestampPattern
      Parameters:
      formattedDate -
      Returns:
      the formatted string
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered