Class BroadleafDialectEnhancer
java.lang.Object
com.broadleafcommerce.common.jpa.data.dialect.BroadleafDialectEnhancer
Enhances a Hibernate
Dialect at runtime by dynamically subclassing it using ByteBuddy to
intercept and override specific behaviors.
This class primarily intercepts getSqlAstTranslatorFactory() in order to return
BroadleafSqlAstTranslatorFactory, allowing Broadleaf Commerce to customize or patch
Hibernate's SQL AST compilation and translation lifecycle.
If subclassing fails (e.g., due to strict module path visibility or classloading restrictions), the enhancer gracefully falls back to returning the original, unmodified dialect.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner interceptor class used by ByteBuddy to delegate method calls. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.hibernate.dialect.Dialectenhance(org.hibernate.dialect.Dialect originalDialect) Enhances the provided HibernateDialectby dynamically subclassing its concrete runtime class.
-
Constructor Details
-
BroadleafDialectEnhancer
public BroadleafDialectEnhancer()
-
-
Method Details
-
enhance
public static org.hibernate.dialect.Dialect enhance(org.hibernate.dialect.Dialect originalDialect) Enhances the provided HibernateDialectby dynamically subclassing its concrete runtime class.The subclass intercepts the
getSqlAstTranslatorFactorymethod to delegate toBroadleafDialectEnhancer.DialectInterceptor.getSqlAstTranslatorFactory(Callable).- Parameters:
originalDialect- the original vendor-specific Hibernate dialect configured for the application- Returns:
- a proxied/subclassed dialect instance that returns Broadleaf's custom SQL AST
translator factory, or the unmodified
originalDialectif enhancement fails
-