{"record":{"id":"00a36700e1cc379d","repo":"jeecgboot/JeecgBoot","slug":"error-00a367","errorCode":null,"errorMessage":"操作失败，表名不能为空！","messagePattern":"操作失败，表名不能为空！","errorType":"exception","errorClass":"JeecgBootException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java","lineNumber":65,"sourceCode":"        if (super.updateById(sysTableWhiteList)) {\n            // 清空缓存\n            whiteListHandler.clear();\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 检查需要新增或更新的实体是否符合规范\n     *\n     * @param sysTableWhiteList\n     */\n    private void checkEntity(SysTableWhiteList sysTableWhiteList) {\n        if (sysTableWhiteList == null) {\n            throw new JeecgBootException(\"操作失败，实体为空！\");\n        }\n        if (oConvertUtils.isEmpty(sysTableWhiteList.getTableName())) {\n            throw new JeecgBootException(\"操作失败，表名不能为空！\");\n        }\n        if (oConvertUtils.isEmpty(sysTableWhiteList.getFieldName())) {\n            throw new JeecgBootException(\"操作失败，字段名不能为空！\");\n        }\n        // 将表名和字段名转换成小写\n        sysTableWhiteList.setTableName(sysTableWhiteList.getTableName().toLowerCase());\n        sysTableWhiteList.setFieldName(sysTableWhiteList.getFieldName().toLowerCase());\n        // 如果status为空，则默认启用\n        if (oConvertUtils.isEmpty(sysTableWhiteList.getStatus())) {\n            sysTableWhiteList.setStatus(CommonConstant.STATUS_1);\n        }\n    }\n\n    @Override\n    public boolean deleteByIds(String ids) {\n        if (oConvertUtils.isEmpty(ids)) {\n            return false;\n        }","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java#L47-L83","documentation":"Thrown by SysTableWhiteListServiceImpl.checkEntity when sysTableWhiteList.getTableName() is empty or null (checked via oConvertUtils.isEmpty). This JeecgBootException enforces that every whitelist entry must specify a table name. The check runs before the table name is lowercased and persisted.","triggerScenarios":"Saving or updating a SysTableWhiteList where the tableName field is null, empty string, or whitespace-only. The request body omitted the tableName field or it was set to an empty value.","commonSituations":"Frontend form submitted without filling in the table name field; API call with a partial JSON body missing tableName; programmatic caller forgot to set the field.","solutions":["Add @NotBlank validation annotation on the tableName field of SysTableWhiteList with @Valid on the controller.","Ensure the frontend form requires tableName before allowing submission.","If calling programmatically, set the tableName before calling the service."],"exampleFix":"// before\nif (oConvertUtils.isEmpty(sysTableWhiteList.getTableName())) {\n    throw new JeecgBootException(\"操作失败，表名不能为空！\");\n}\n\n// after — bean validation at the entity level\npublic class SysTableWhiteList {\n    @NotBlank(message = \"表名不能为空\")\n    private String tableName;\n    // ...\n}\n// Controller:\npublic Result<?> save(@Valid @RequestBody SysTableWhiteList entity) { ... }","handlingStrategy":"validation","validationCode":"// Validate tableName is non-empty before calling service\nif (sysTableWhiteList == null || oConvertUtils.isEmpty(sysTableWhiteList.getTableName())) {\n    return Result.error(\"操作失败，表名不能为空\");\n}\nservice.save(sysTableWhiteList);","typeGuard":"public boolean hasTableName(SysTableWhiteList entity) {\n    return entity != null && oConvertUtils.isNotEmpty(entity.getTableName());\n}","tryCatchPattern":"try {\n    service.save(sysTableWhiteList);\n} catch (JeecgBootException e) {\n    if (e.getMessage().contains(\"表名不能为空\")) {\n        return Result.error(\"请填写表名后重试\");\n    }\n    throw e;\n}","preventionTips":["Add @NotBlank on the tableName field with bean validation.","Require tableName in the frontend form before submission.","Use @Valid on the controller @RequestBody to fail fast."],"tags":["jeecg-boot","whitelist","validation","required-field","entity"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}