diff --git a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java index b8f0cd6..c190e7d 100644 --- a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java +++ b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java @@ -86,18 +86,18 @@ public abstract class PlusoneJdbcDaoSupport { return update(sql, new MapSqlParameterSource(paramName, value)); } - protected final int batchUpdate(String sql, SqlParameterSource[] batchArgs) { + protected final long batchUpdate(String sql, SqlParameterSource[] batchArgs) { int[] i = this.jdbc.batchUpdate(sql, batchArgs); return NumberUtil.sum(i); } - protected final int batchUpdate(String sql, Stream c, + protected final long batchUpdate(String sql, Stream c, @Nonnull Function paramSourceBuilder) { int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder)); return NumberUtil.sum(i); } - protected final int batchUpdate(String sql, Collection c, + protected final long batchUpdate(String sql, Collection c, @Nonnull Function paramSourceBuilder) { int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder)); return NumberUtil.sum(i); diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java index 3e28167..f9aea5c 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java @@ -31,7 +31,7 @@ class AccountRoleRefDAO extends PlusoneJdbcDaoSupport { } void insertAccountRoleRefs(Long accountId, Set roleRefs) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_account_role (account_id, role_id) VALUES (:accountId, :roleId)", roleRefs, (Long roleId) -> new MapSqlParameterSource() diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java index 19133c3..f1d981b 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java @@ -21,11 +21,11 @@ class DictValueDAO extends PlusoneJdbcDaoSupport { void updateDictValues(Dict entity) { update("DELETE FROM sys_dict_value WHERE dict_type = :dictType", "dictType", entity.getId().orElseThrow()); - int i = insertDictValues(entity.getId().orElseThrow(), entity); + long i = insertDictValues(entity.getId().orElseThrow(), entity); assertResultEquals(i, entity.count()); } - int insertDictValues(Long dictId, Dict entity) { + long insertDictValues(Long dictId, Dict entity) { if (Objects.isNull(dictId) || Objects.isNull(entity) || CollectionUtils.isEmpty(entity.getValues())) { return 0; } diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java index 248ef97..9a0276f 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java @@ -29,7 +29,7 @@ class RoleMenuRefDAO extends PlusoneJdbcDaoSupport { } void saveRoleMenuRefs(Long roleId, Role entity) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_role_menu(role_id, menu_id) VALUES (:roleId, :menuId)", entity.getMenus(), menuRef -> new MapSqlParameterSource() diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java index bbdd44a..2b69980 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java @@ -30,7 +30,7 @@ class RolePermissionRefDAO extends PlusoneJdbcDaoSupport { } void saveRolePermissionRefs(Long roleId, Role entity) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_role_permission(role_id, permission_id) VALUES (:roleId, :permissionId)", entity.getPermissions(), actionRef -> new MapSqlParameterSource()