
pers.zr.opensource.magic.dao.matcher.Matcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magic-dao Show documentation
Show all versions of magic-dao Show documentation
simplify to access database with java.
package pers.zr.opensource.magic.dao.matcher;
import pers.zr.opensource.magic.dao.constants.MatchType;
/**
* Created by zhurong on 2016-4-28.
*/
public abstract class Matcher {
protected String column;
public abstract MatchType getMatchType();
public abstract Object[] getValues();
public String getColumn() {
return column;
}
protected String convertSpecialChar(String value, MatchType matchType) {
String newValue = value;
if(MatchType.LIKE == matchType) {
newValue = newValue.replace("\\", "\\\\");
newValue = newValue.replace("%", "\\%");
newValue = newValue.replace("_", "\\_");
}
return newValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy