Closed CraKeyBoy closed 2 months ago
Hi there. The code that you reference is for rendering the HQL fragment that is passed to Hibernate ORM. You can of course create a custom DbmsDialect
that extends MySQLDbmsDialect
and override the getDefaultEscapeCharacter()
method to return null
instead. This should allow you to workaround this problem.
Note that Clickhouse is not "supported" i.e. we don't regularly test with it or have a DbmsDialect
implementation. Hibernate ORM also has no "support" for that database, so you might run into other issues. If you care about that database, please consider contributing support for it.
Also see the documentation that explains a bit about DbmsDialect
.
OK,I use this method。thx。
Description
I use ClickHouse as a database and employ Blaze-Persistence for dynamic querying. Starting from version 1.6.9, Blaze-Persistence automatically concatenates the statement "ESCAPE ''" when performing a "LIKE" query by default. However, this causes an error in ClickHouse because ClickHouse does not support appending "ESCAPE" after a "LIKE" query. Could you please help me with resolving this error? Additionally, I would like to know why it is necessary to concatenate the statement "ESCAPE ''".
I have already located the source code for the following class: "ResolvingQueryGenerator ". Line 753 ~ 762
Expected behavior
cb.where("s.name").like().value("%" + request.getUserName() + "%").noEscape();
Actual behavior
cb.where("s.name").like().value("%" + request.getUserName() + "%").noEscape();
Steps to reproduce
Just use a like query and look the query sql.
Environment
Version: 1.6.11 Spring Boot: 2.3.12 JPA-Provider: Hibernate 5.4.32.Final DBMS: clickhouse use mysql8 DbmsDialect Application Server: N/A