IDEMPIERE-1539 search without "%" mark in value, name, description fields
This commit is contained in:
parent
fce33028c3
commit
ba541e7dc0
|
@ -0,0 +1,11 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- Dec 23, 2013 1:36:38 PM COT
|
||||||
|
-- IDEMPIERE-1539
|
||||||
|
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200168,200061,'9562f4db-97a9-4df5-99d0-b2f5bc0e2b4c','Full Like','LIKE',TO_DATE('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201312231347_IDEMPIERE-1539.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- Dec 23, 2013 1:36:38 PM COT
|
||||||
|
-- IDEMPIERE-1539
|
||||||
|
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,AD_Ref_List_UU,Name,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200168,200061,'9562f4db-97a9-4df5-99d0-b2f5bc0e2b4c','Full Like','LIKE',TO_TIMESTAMP('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-12-23 13:36:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201312231347_IDEMPIERE-1539.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class X_AD_InfoColumn extends PO implements I_AD_InfoColumn, I_Persistent
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 20171031L;
|
private static final long serialVersionUID = 20180719L;
|
||||||
|
|
||||||
/** Standard Constructor */
|
/** Standard Constructor */
|
||||||
public X_AD_InfoColumn (Properties ctx, int AD_InfoColumn_ID, String trxName)
|
public X_AD_InfoColumn (Properties ctx, int AD_InfoColumn_ID, String trxName)
|
||||||
|
@ -572,6 +572,8 @@ public class X_AD_InfoColumn extends PO implements I_AD_InfoColumn, I_Persistent
|
||||||
public static final String QUERYOPERATOR_LeEq = "<=";
|
public static final String QUERYOPERATOR_LeEq = "<=";
|
||||||
/** != = != */
|
/** != = != */
|
||||||
public static final String QUERYOPERATOR_NotEq = "!=";
|
public static final String QUERYOPERATOR_NotEq = "!=";
|
||||||
|
/** Full Like = LIKE */
|
||||||
|
public static final String QUERYOPERATOR_FullLike = "LIKE";
|
||||||
/** Set Query Operator.
|
/** Set Query Operator.
|
||||||
@param QueryOperator
|
@param QueryOperator
|
||||||
Operator for database query
|
Operator for database query
|
||||||
|
|
|
@ -987,14 +987,17 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
||||||
if (value instanceof Boolean) {
|
if (value instanceof Boolean) {
|
||||||
pstmt.setString(parameterIndex, ((Boolean) value).booleanValue() ? "Y" : "N");
|
pstmt.setString(parameterIndex, ((Boolean) value).booleanValue() ? "Y" : "N");
|
||||||
} else if (value instanceof String) {
|
} else if (value instanceof String) {
|
||||||
|
StringBuilder valueStr = new StringBuilder(value.toString());
|
||||||
if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_Like)) {
|
if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_Like)) {
|
||||||
StringBuilder valueStr = new StringBuilder(value.toString());
|
|
||||||
if (!valueStr.toString().endsWith("%"))
|
if (!valueStr.toString().endsWith("%"))
|
||||||
valueStr.append("%");
|
valueStr.append("%");
|
||||||
pstmt.setString(parameterIndex, valueStr.toString());
|
} else if (queryOperator.equals(X_AD_InfoColumn.QUERYOPERATOR_FullLike)) {
|
||||||
} else {
|
if (!valueStr.toString().startsWith("%"))
|
||||||
pstmt.setString(parameterIndex, (String)value);
|
valueStr.insert(0, "%");
|
||||||
|
if (!valueStr.toString().endsWith("%"))
|
||||||
|
valueStr.append("%");
|
||||||
}
|
}
|
||||||
|
pstmt.setString(parameterIndex, valueStr.toString());
|
||||||
} else {
|
} else {
|
||||||
pstmt.setObject(parameterIndex, value);
|
pstmt.setObject(parameterIndex, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue