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
Denote special behavior per database platform required for support of the simple sandbox
lifecycle strategy. See
SimplePromotionStrategy.- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertTimestamp(String formattedDate) Performs a string conversion based on the behavior timestampPatternFully qualified classname of the Hibernate dialect used to support the target database platform.Database platform specific representation of a false boolean.intgetOrder()Whether or not the platform requires table names to be specified using lower case (e.g.Database platform specific command to convert from a hexidecimal version of a string into a standard string character representation.Database platform specific command to convert from a date/time string SQL parameter into a timestamp representation.Database platform specific representation of a true boolean.
-
Constructor Details
-
DatabasePlatformBehavior
public DatabasePlatformBehavior(String dialectName, Boolean requiresLowerCaseTableName, String safeStringPattern, String timestampPattern, Boolean integerBooleanRepresentation) - Parameters:
dialectName- Fully qualified classname of the Hibernate dialectrequiresLowerCaseTableName- Whether or not the platform requires table names to be specified using lower casesafeStringPattern- Database platform specific command to convert from a hexidecimal version of a stringtimestampPattern- Database platform specific command to convert from a UNIX epoch timestampintegerBooleanRepresentation- Whether or not the Hibernate dialect for the database platform supports booleans as an integer column
-
-
Method Details
-
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
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
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
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
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
Fully qualified classname of the Hibernate dialect used to support the target database platform.- Returns:
- Fully qualified classname of the Hibernate dialect
-
convertTimestamp
Performs a string conversion based on the behavior timestampPattern- Parameters:
formattedDate-- Returns:
- the formatted string
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-