package foundation.persist.adapter;
|
|
import foundation.server.config.DBaseType;
|
|
public class EmptyAdapter implements IDBAdapter {
|
@Override
|
public String toSqlString(DBaseType type) {
|
return null;
|
}
|
|
@Override
|
public String getFunciton(DBaseType dbaseType, String functionName) {
|
if ("ifEmpty".equalsIgnoreCase(functionName)) {
|
return getEmpty(dbaseType);
|
}
|
|
return null;
|
}
|
|
|
private String getEmpty(DBaseType dbaseType) {
|
if (dbaseType.isOracle()) {
|
return "NVL";
|
}
|
else if (dbaseType.isMySQL()) {
|
return "IFNULL";
|
}
|
else if (dbaseType.isSQLServer()) {
|
return "ISNULL";
|
}
|
|
return "IFNULL";
|
}
|
|
|
}
|