Class MySQLDatabasePlatformBehavior
java.lang.Object
com.broadleafcommerce.enterprise.workflow.dao.simple.DatabasePlatformBehavior
com.broadleafcommerce.enterprise.workflow.dao.simple.MySQLDatabasePlatformBehavior
- All Implemented Interfaces:
org.springframework.core.Ordered
Provides overrides specific to the needs to MySQL. The MySQL JDBC driver converts dates to the database
timezone. Since SimpleTransition uses raws SQL with no timezone conversions, the times get off when
promoting/approving. This class works in conjunction with
PlatformJDBCUtilImpl to wrap the dates
with the proper MySQL functions for timezone conversion.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected static final org.apache.commons.logging.LogFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertTimestamp(String formattedDate) Override for MySQL.protected voidlazyInitPlatformVariables checks with the MySQL database to verify that the database supports the app server TimeZone so that timezone conversations can take place correctly.Methods inherited from class com.broadleafcommerce.enterprise.workflow.dao.simple.DatabasePlatformBehavior
getDialectName, getFalseBooleanRepresentation, getOrder, getRequiresLowerCaseTableName, getSafeStringPattern, getTimestampPattern, getTrueBooleanRepresentation
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
em
protected jakarta.persistence.EntityManager em
-
-
Constructor Details
-
MySQLDatabasePlatformBehavior
-
-
Method Details
-
convertTimestamp
Override for MySQL. MySQL converts times from the app server timezone to the database timezone. The timestampPattern for MySQL take this into account and requires a second pattern parameter for the app server timezone.- Overrides:
convertTimestampin classDatabasePlatformBehavior- Parameters:
formattedDate-- Returns:
- the date/time string with appropriate MySQL functions for conversation
-
lazyInitPlatformVariables
protected void lazyInitPlatformVariables()lazyInitPlatformVariables checks with the MySQL database to verify that the database supports the app server TimeZone so that timezone conversations can take place correctly. The timezone will default to UTC if MySQL does not support the app server timezone.
-