Skip to content

Commit 8d16e66

Browse files
authored
Update AbstractSQLExecutor.java
fix code format
1 parent 27d7e01 commit 8d16e66

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,14 @@ protected String getKey(@NotNull SQLConfig config, @NotNull ResultSet rs, @NotNu
711711
String key = rsmd.getColumnLabel(columnIndex);// dotIndex < 0 ? lable : lable.substring(dotIndex + 1);
712712
if (config.isHive()) {
713713
String table_name = config.getTable();
714-
if (AbstractSQLConfig.TABLE_KEY_MAP.containsKey(table_name)) table_name = AbstractSQLConfig.TABLE_KEY_MAP.get(table_name);
714+
if (AbstractSQLConfig.TABLE_KEY_MAP.containsKey(table_name)) {
715+
table_name = AbstractSQLConfig.TABLE_KEY_MAP.get(table_name);
716+
}
715717
String pattern = "^" + table_name + "\\." + "[a-zA-Z]+$";
716718
boolean isMatch = Pattern.matches(pattern, key);
717-
if (isMatch) key = key.split("\\.")[1];
719+
if (isMatch) {
720+
key = key.split("\\.")[1];
721+
}
718722
}
719723
return key;
720724
}
@@ -972,7 +976,9 @@ public ResultSet executeQuery(@NotNull SQLConfig config) throws Exception {
972976
public int executeUpdate(@NotNull SQLConfig config) throws Exception {
973977
PreparedStatement s = getStatement(config);
974978
int count = s.executeUpdate(); //PreparedStatement 不用传 SQL
975-
if (config.isHive() && count==0) count = 1;
979+
if (config.isHive() && count==0) {
980+
count = 1;
981+
}
976982

977983
if (config.getMethod() == RequestMethod.POST && config.getId() == null) { //自增id
978984
ResultSet rs = s.getGeneratedKeys();

0 commit comments

Comments
 (0)