IDEMPIERE-1906 Use postgresql SIMILAR TO instead of LIKE / https://groups.google.com/d/msg/idempiere/7MQr3bCKet4/DBdxeLFaBgAJ

This commit is contained in:
Carlos Ruiz 2018-05-02 13:53:49 +02:00
parent 16093fb33c
commit 96ce843dbc
1 changed files with 3 additions and 0 deletions

View File

@ -166,6 +166,9 @@ public class WAccountEditor extends WEditor implements ContextMenuListener
{
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, C_AcctSchema_ID);
boolean useSimilarTo = "Y".equals(Env.getContext(Env.getCtx(), "P|IsUseSimilarTo"));
if (useSimilarTo && text.contains("*"))
text = text.replaceAll("\\*", "\\\\*");
pstmt.setString(2, text.toUpperCase());
pstmt.setString(3, text.toUpperCase());
rs = pstmt.executeQuery();