Comments (6)
Thank you for your proposal.
Could you tell me which RDBMS you are using and what kind of SQL you would like to execute?
Some RDBMS provide a feature called collation, which might meet your needs.
https://learn.microsoft.com/en-us/sql/relational-databases/collations/collation-and-unicode-support?view=sql-server-ver16
from doma.
Thank you for sharing the information.
I think creating a custom function would be suitable in your case.
- Create a class that inherits from OracleExpressionFunctions and write a method that generates the string to be passed to the pattern argument of the REGEXP_LIKE function.
package example:
public class MyFunctions extends OracleExpressionFunctions {
public String insensitive(String text) {
return ...;
}
}
- Pass an instance of the above MyFunctions to the constructor of OracleDialect.
OracleDialect dialect = new OracleDialect(new MyFunctions());
- Specify the fully qualified name of the above MyFunctions in the options for annotation processing (the following example is when writing in build.gradle.kts).
tasks {
compileJava {
options.compilerArgs.addAll(listOf("-Adoma.expr.functions=example.MyFunctions"))
}
}
- Call the method defined in MyFunctions from the SQL template.
SELECT * FROM users
WHERE REGEXP_LIKE ( users.name, /* @insensitive(name) */'[[=t=]][[=a=]][[=r=]][[=o=]]')
See also https://doma.readthedocs.io/en/latest/expression/#using-custom-functions.
from doma.
No, there are no plans to do so at this time.
There are two reasons for this:
- As you mentioned, it is challenging to accommodate different RDBMS.
- Even if we focused on a specific RDBMS, we believe it would be difficult to write a generic logic that meets the needs of many users.
If you try out a custom function and it works well, I would be happy if you could share that function with us. If many users agree with that function, we might consider incorporating it into Doma.
from doma.
Thank you for your response and for considering my feature request.
Could you tell me which RDBMS you are using and what kind of SQL you would like to execute?
I am currently using Oracle.
Here's an example of the kind of SQL I would like to execute:
SELECT * FROM users
WHERE REGEXP_LIKE ( users.name, '[[=t=]][[=a=]][[=r=]][[=o=]]')
from doma.
@nakamura-to
Thank you for your response, despite it being a day off.
Is there any plan to include a custom function named @insensitive in the next update? I understand it might be challenging given the need to accommodate different RDBMS.
from doma.
Understood.
Since this issue has been resolved, I will go ahead and close it.
Thank you very much for your assistance.
from doma.
Related Issues (20)
- ( is missing when generating insert sql into auto_increment column only table HOT 2
- Some NativeSQL set queryTimeout to fetchSize HOT 1
- Criteria Apiについて、leftJoinの条件の書き方 HOT 2
- left joinについて HOT 6
- [Security] Workflow gradle-wrapper-validation.yml is using vulnerable action gradle/wrapper-validation-action
- Missing limit, offset words when select with top level `WITH` word HOT 4
- Criteria APIにて、タプルを使ったIN述語を3項目以上で使用する方法を教えてほしい HOT 1
- Criteria APIにて、タプルを使ったIN述語を3項目以上で使用する方法を教えてほしい HOT 3
- MySQLでSelectOptioinsでlimit 0を指定するとlimit 0, 18446744073709551615のSQLが作成される HOT 2
- Criteria APIでページングを実装するとき、絞り込み前の総件数を取得する方法はありますか? HOT 1
- OriginalState comparing BigDecimal by using equals HOT 1
- Doma APT module-info.java is missing `provides javax.annotation.processing.Processor` HOT 3
- MySQLのSelectOptioins.countで`SELECT COUNT`に変える方法はありますか? HOT 2
- Javaを8から11に上げた時、Eclipse上での注釈処理が遅くなる HOT 13
- SelectOptionsでソートしたい HOT 4
- 2.53.3以降でDomainConverterにenumを指定するとコンパイルエラーが発生する HOT 4
- Prevent prepareIdValue if ignoreGeneratedKeys is true HOT 4
- DOMA4084 error occurs when including the Embeddable class HOT 5
- MSSQL: TOP keyword is appended in wrong place when select with DISTINCT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doma.