Does Eclipselink support queries containing regular expression?

后端 未结 1 612
故里飘歌
故里飘歌 2021-01-21 11:21

I\'ve seen that DBMS like MySQL supports query containing regular expressions. Does Eclipselink support this?

I have to retrieve entities having some String attribute ma

相关标签:
1条回答
  • 2021-01-21 11:34

    MySQL uses REGEX or RLIKE for regular expression queries. JPQL does not support these operators, so you can use a native SQL query.

    In EclipseLink you could define your own ExpressionOperator for these, and use it in an Expression query, but not currently with JPQL. JPQL does support calling database functions using FUNC, but these have different syntax than functions. You could extend the MySQLPlatform to make #like us REGEX or RLIKE.

    Please log a bug for this on EclipseLink. Most databases now support regex, so this support should be available in JPQL.

    0 讨论(0)
提交回复
热议问题