Hello,
I have the following entity:
{code}
@Entity @FilterDef(name = "active_filter") @Filter(name = "active_filter", condition = "(({alias}.active IS NULL OR {alias}.active = TRUE) OR (CURRENT_TIMESTAMP BETWEEN {alias}.active_from AND {alias}.active_to))", deduceAliasInjectionPoints = false) public class ProductEntity {
} {code}
When I use this entity with the filter enabled against Oracle database I get the following exception: {code} Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "TRUE": invalid identifier
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) {code}
If I change the filter condition to be { { code} (({alias}.active IS NULL OR {alias}.active = 1) OR (CURRENT_TIMESTAMP BETWEEN {alias}.active_from AND {alias}.active_to)) {code } } then the Oracle works fine but I will probably break the MySQL clients.
I think is caused because the condition is not translated with the specified dialect (I have specified this dialect: "org.hibernate.dialect.Oracle12cDialect") |
|