📄 dbstringvalue.java
字号:
package com.exp.dao.util.dbvalueimp;
import com.exp.dao.dialect.Dialect;
import com.exp.dao.util.DBValue;
/**
* 得到字符类型字段的字段值
*
* @author zhanghf
* @version 1.0
*/
public class DBStringValue extends DBValue {
public DBStringValue(String value, Dialect dialect) {
super(value, dialect);
}
/**
* 得到字符串:号单引号,对字符串中存在的单引号已作处理
*
* @return
*/
public String getValue() {
if (this.value != null) {
return dialect.openQuote() + this.prepareDBValue(this.value)
+ dialect.closeQuote();
} else {
return this.getNull();
}
}
protected String prepareDBValue(String value) {
if (value == null)
return value;
String realValue = value;
realValue = realValue.replaceAll(this.dialect.openQuote(), this.dialect
.openQuote()
+ this.dialect.openQuote());
if (!this.dialect.openQuote().equals(this.dialect.closeQuote())) {
realValue = realValue.replaceAll(this.dialect.closeQuote(),
this.dialect.closeQuote() + this.dialect.closeQuote());
}
return realValue;
}
public boolean emptySkip() {
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -