Slight performance improvement
This commit is contained in:
parent
f16f4d8f2d
commit
7e01cbaffa
@ -57,6 +57,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@ -111,6 +112,11 @@ final class Util {
|
||||
*/
|
||||
private static final Map<String, Class<?>> EXECUTE_LISTENERS = new ConcurrentHashMap<String, Class<?>>();
|
||||
|
||||
/**
|
||||
* A pattern for the JDBC escape syntax
|
||||
*/
|
||||
private static final Pattern JDBC_ESCAPE_PATTERN = Pattern.compile("\\{(fn|d|t|ts)\\b.*");
|
||||
|
||||
/**
|
||||
* Create a new Oracle-style VARRAY {@link ArrayRecord}
|
||||
*/
|
||||
@ -380,7 +386,7 @@ final class Util {
|
||||
else if (sqlChars[i] == '{' && !stringLiteral && bindIndex < substitutes.size()) {
|
||||
|
||||
// [#1461] Be careful not to match any JDBC escape syntax
|
||||
if (sql.substring(i).matches("\\{(fn|d|t|ts)\\b.*")) {
|
||||
if (JDBC_ESCAPE_PATTERN.matcher(sql.substring(i)).matches()) {
|
||||
context.sql(sqlChars[i]);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user