Class BroadleafSqlAstTranslatorFactory

java.lang.Object
org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory
com.broadleafcommerce.common.jpa.data.dialect.BroadleafSqlAstTranslatorFactory
All Implemented Interfaces:
org.hibernate.sql.ast.SqlAstTranslatorFactory

public class BroadleafSqlAstTranslatorFactory extends org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory
A custom SqlAstTranslatorFactory that extends Hibernate's standard implementation to intercept and customize SQL AST generation.

This factory wraps an existing SqlAstTranslatorFactory (the delegate) and uses ByteBuddy to dynamically subclass the generated SqlAstTranslator at runtime to override visitBooleanExpressionPredicate. This ensures that the underlying dialect-specific translator logic is preserved (e.g., PostgreSQLSqlAstTranslator) while still allowing BooleanExpressionPredicateHelper to safely inspect and rewrite boolean expression predicates prior to standard translation.

See Also:
  • StandardSqlAstTranslatorFactory
  • SqlAstTranslator
  • Constructor Details

    • BroadleafSqlAstTranslatorFactory

      public BroadleafSqlAstTranslatorFactory()
    • BroadleafSqlAstTranslatorFactory

      public BroadleafSqlAstTranslatorFactory(org.hibernate.sql.ast.SqlAstTranslatorFactory delegate)
  • Method Details

    • buildTranslator

      protected <T extends org.hibernate.sql.exec.spi.JdbcOperation> org.hibernate.sql.ast.SqlAstTranslator<T> buildTranslator(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory, org.hibernate.sql.ast.tree.Statement statement)
      Overrides:
      buildTranslator in class org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory