mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复PostgreSQL使用upsert字段大小写问题问题
This commit is contained in:
@@ -14,6 +14,7 @@ package org.dromara.hutool.db.dialect.impl;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.db.Entity;
|
||||
import org.dromara.hutool.db.StatementUtil;
|
||||
@@ -28,14 +29,17 @@ import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Postgree方言
|
||||
* @author loolly
|
||||
*
|
||||
* @author loolly
|
||||
*/
|
||||
public class PostgresqlDialect extends AnsiSqlDialect {
|
||||
private static final long serialVersionUID = 3889210427543389642L;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
public PostgresqlDialect() {
|
||||
quoteWrapper = new QuoteWrapper('"');
|
||||
quoteWrapper = new QuoteWrapper(CharUtil.DOUBLE_QUOTES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,7 +69,7 @@ public class PostgresqlDialect extends AnsiSqlDialect{
|
||||
|
||||
final String wrapedField = (null != quoteWrapper) ? quoteWrapper.wrap(field) : field;
|
||||
fieldsPart.append(wrapedField);
|
||||
updateHolder.append(wrapedField).append("=EXCLUDED.").append(field);
|
||||
updateHolder.append(wrapedField).append("=EXCLUDED.").append(wrapedField);
|
||||
placeHolder.append("?");
|
||||
builder.addParams(value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user