Search in sources :

Example 6 with QueryCondition

use of com.navercorp.dbtools.sqlmap.parser.QueryCondition in project cubrid-manager by CUBRID.

the class SqlmapPersistUtil method changeUsedCondition.

public void changeUsedCondition(String queryId, String condition, boolean needToUse) {
    if (condition == null) {
        return;
    }
    List<QueryCondition> queryConditions = condValues.get(queryId);
    if (queryConditions == null) {
        return;
    }
    boolean found = false;
    for (QueryCondition queryCondition : queryConditions) {
        if (condition.equals(queryCondition.getConditionKey() + ":" + queryCondition.getConditionBody())) {
            found = true;
            break;
        }
    }
    if (!found) {
        return;
    }
    Set<String> condSet = usedConditions.get(queryId);
    if (needToUse) {
        condSet.add(condition);
    } else {
        condSet.remove(condition);
    }
}
Also used : QueryCondition(com.navercorp.dbtools.sqlmap.parser.QueryCondition)

Aggregations

QueryCondition (com.navercorp.dbtools.sqlmap.parser.QueryCondition)6 MapperFile (com.navercorp.dbtools.sqlmap.parser.MapperFile)2 MapperParserImpl (com.navercorp.dbtools.sqlmap.parser.MapperParserImpl)2 HashSet (java.util.HashSet)2 PartInitException (org.eclipse.ui.PartInitException)2 QueryEditorPart (com.cubrid.common.ui.query.editor.QueryEditorPart)1 BindParameter (com.cubrid.common.ui.query.sqlmap.BindParameter)1 MapperParser (com.navercorp.dbtools.sqlmap.parser.MapperParser)1 DynamicTag (com.nhn.dbtool.query.parser.sqlmap.model.DynamicTag)1 IsEmptyTag (com.nhn.dbtool.query.parser.sqlmap.model.IsEmptyTag)1 IsNotEmptyTag (com.nhn.dbtool.query.parser.sqlmap.model.IsNotEmptyTag)1 IterateTag (com.nhn.dbtool.query.parser.sqlmap.model.IterateTag)1 MyBatisTestCondition (com.nhn.dbtool.query.parser.sqlmap.model.MyBatisTestCondition)1 SelectKeyTag (com.nhn.dbtool.query.parser.sqlmap.model.SelectKeyTag)1 SqlMapCondition (com.nhn.dbtool.query.parser.sqlmap.model.SqlMapCondition)1 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1