I tried to figure out with custom dialect for regexp function.
I did this:
public class CustomMySQLDialect extends MySQLDialect {
public CustomMySQLDialect() {
super();
registerFunction("regexp", new SQLFunctionTemplate(IntegerType.INSTANCE, "?1 regexp ?2"));
}
}
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘seoprimary0_.regexp ‘^/catalog/$’ order by rand() limit 1’ at line 1
But still no success:
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘seoprimary0_.regexp ‘^/catalog/$’ order by rand() limit 1’ at line 1