Example of mapping that skips the JdbcParameterRenderer:
{code:java} @FilterDef(name = "current", defaultCondition = "deleted = false") @FilterDef(name = "region", defaultCondition = "region = :region", parameters = @ParamDef(name = "region", type = org.hibernate.type.descriptor.java.StringJavaType.class)) @Entity(name = "Element") @Table(name = "Element") @Filter(name = "current") @Filter(name = "region") public static class Element { ... }{code}
A test class is availble on my repository: [https://github.com/DavideD/hibernate-orm/blob/filterTest/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/FilterWithParameterRendererTest.java|https://github.com/DavideD/hibernate-orm/blob/filterTest/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/FilterWithParameterRendererTest.java|smart-link]
It’s possible to see in [FilterHelper|https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/internal/FilterHelper.java#L178] that the renderer is never called when parameters are required. |
|