IDEMPIERE-1906 Use postgresql SIMILAR TO instead of LIKE / https://groups.google.com/d/msg/idempiere/7MQr3bCKet4/DBdxeLFaBgAJ
This commit is contained in:
parent
16093fb33c
commit
96ce843dbc
|
@ -166,6 +166,9 @@ public class WAccountEditor extends WEditor implements ContextMenuListener
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, C_AcctSchema_ID);
|
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(2, text.toUpperCase());
|
||||||
pstmt.setString(3, text.toUpperCase());
|
pstmt.setString(3, text.toUpperCase());
|
||||||
rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
|
|
Loading…
Reference in New Issue