{"id":44029,"date":"2025-06-16T14:28:50","date_gmt":"2025-06-16T06:28:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/44029.html"},"modified":"2025-06-16T14:28:50","modified_gmt":"2025-06-16T06:28:50","slug":"springjpa%e7%bb%9f%e8%ae%a1%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8%e8%a1%8c%e6%95%b0%e5%8f%8a%e6%9b%b4%e6%96%b0%e9%a2%91%e7%8e%87","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/44029.html","title":{"rendered":"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387"},"content":{"rendered":"<p>\u6570\u636e\u5904\u7406\u7684\u89c4\u8303\u4e2d&#xff0c;\u7b2c\u4e00\u4e2a\u5c42\u6b21\u662fODS&#xff0c;\u4e00\u822c\u6210\u4e3a\u8d34\u5143\u5c42&#xff0c;\u6700\u9760\u8fd1\u4e1a\u52a1\u5e93\u7684\u6570\u636e\u3002\u9700\u8981\u7edf\u8ba1ODS\u4e2d\u6709\u6570\u636e\u8868\u7684\u884c\u6570&#xff0c;\u53ca\u66f4\u65b0\u9891\u7387\u3002&#xff08;\u5047\u8bbe\u5728ODS\u4e2d\u662fMysql\u6570\u636e\u5e93&#xff09;<\/p>\n<h2>\u9700\u6c42\u63cf\u8ff0<\/h2>\n<p>\u6709\u591a\u4e2amysql\u7684\u5b9e\u4f8b&#xff0c;\u6bcf\u4e2a\u5b9e\u4f8b\u4e2d\u6709\u591a\u4e2a\u6570\u636e\u5e93schema&#xff0c;\u6bcf\u4e2ashema\u6709\u591a\u4e2a\u6570\u636e\u8868\u3002\u539f\u59cb\u7684\u6570\u636e\u5b9a\u65f6\u589e\u91cf\u540c\u6b65\u6216\u5168\u91cf\u540c\u6b65\u5230ODS\u4e2d&#xff0c;ODS\u4e2d\u4e0d\u5305\u542b\u6570\u636e\u7684\u5386\u53f2\u7248\u672c\u3002\u662f\u540c\u6b65\u7684\u6700\u65b0\u7248\u672c\u3002<\/p>\n<p>\u6839\u636e\u5f53\u524d\u7684\u73b0\u72b6&#xff0c;\u9700\u8981\u7edf\u8ba1<\/p>\n<p>\u6bcf\u4e2a\u8868\u6709\u591a\u5c11\u884c<\/p>\n<p>\u6bcf\u4e2a\u8868\u66f4\u65b0\u7684\u9891\u7387<\/p>\n<p>\u6bcf\u4e2a\u8868\u7684\u5b57\u6bb5\u8be6\u7ec6<\/p>\n<\/p>\n<h2>\u5b9e\u73b0\u601d\u8def<\/h2>\n<h3>\u5206\u6790\u9700\u6c42<\/h3>\n<p>\u901a\u8fc7\u8bfb\u53d6myql\u7684\u5143\u6570\u636e&#xff0c;\u83b7\u53d6\u5230\u6bcf\u4e2a\u6570\u636e\u8868\u7684\u884c\u6570\u3002\u7136\u540e\u6301\u7eed\u4fdd\u5b58\u4e00\u5b9a\u7684\u5468\u671f&#xff0c;\u598260\u5929&#xff0c;\u53ef\u4ee5\u89c2\u5bdf\u4e00\u4e0b\u5b83\u7684\u8d8b\u52bf&#xff0c;\u5982\u679c\u572860\u5929\u4e4b\u540e&#xff0c;\u90fd\u6ca1\u6709\u66f4\u65b0&#xff0c;\u57fa\u672c\u4e0a\u4e0d\u662f\u9ad8\u9891\u6570\u636e\u3002<\/p>\n<p>\u901a\u8fc7\u8bfb\u53d6mysql\u7684\u5143\u6570\u636e&#xff0c;\u83b7\u53d6\u6bcf\u4e2a\u8868\u7684\u5b57\u6bb5\u4fe1\u606f&#xff0c;\u53ef\u4ee5\u83b7\u53d6\u5230\u6bcf\u4e2a\u8868\u7684\u5b57\u6bb5\u8be6\u7ec6\u4fe1\u606f&#xff0c;\u8fd9\u4e2a\u4e0d\u9700\u8981\u4fdd\u7559\u5386\u53f2\u7248\u672c&#xff0c;\u4ec5\u4ec5\u4fdd\u7559\u6700\u65b0\u7684\u4e00\u4e2a\u7248\u672c<\/p>\n<h2>\u6280\u672f\u65b9\u6848<\/h2>\n<p>\u4f7f\u7528SpringBoot&#043;jpa\u7684\u65b9\u5f0f\u6765\u8fdb\u884c\u5b9e\u73b0<\/p>\n<h3 style=\"background-color:transparent\">\u8868\u5143\u6570\u636e\u83b7\u53d6<\/h3>\n<p>\u89e3\u6790config.xml\u6587\u4ef6&#xff0c;\u5f62\u6210\u4e00\u4e2a\u7c7b\u3002\u7136\u540e\u91c7\u7528jdbc\u7684\u539f\u59cb\u65b9\u5f0f\u8fdb\u884c\u5faa\u73af\u8fde\u63a5\u5404url\u3002\u83b7\u53d6\u5230\u6570\u636e\u4e4b\u540e&#xff0c;\u8f6c\u5165\u5230\u76f8\u5e94\u7684\u7c7b\u4e2d\u3002\u4f7f\u7528jpa\u7684&#064;entity\u7684\u65b9\u5f0f&#xff0c;\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u4e2d<\/p>\n<h3>\u5217\u5143\u6570\u636e\u83b7\u53d6<\/h3>\n<p>\u89e3\u6790config.xml\u6587\u4ef6&#xff0c;\u5f62\u6210\u4e00\u4e2a\u7c7b\u3002\u7136\u540e\u91c7\u7528jdbc\u7684\u539f\u59cb\u65b9\u5f0f\u8fdb\u884c\u5faa\u73af\u8fde\u63a5\u5404url\u3002\u83b7\u53d6\u5230\u5217\u7684\u6570\u636e\u4e4b\u540e&#xff0c;\u8f6c\u5165\u5230\u76f8\u5e94\u7684\u7c7b\u4e2d\u3002\u4f7f\u7528jpa\u7684&#064;entity\u7684\u65b9\u5f0f&#xff0c;\u5c06\u6570\u636e \u5206\u6279 \u4fdd\u5b58\u5230\u6570\u636e\u5e93\u4e2d<\/p>\n<h2 style=\"background-color:transparent\">\u975e\u529f\u80fd\u6027<\/h2>\n<p>\u4e3a\u4fdd\u969c\u7a0b\u5e8f\u7684\u7a33\u5065\u6027\u8fd0\u884c&#xff0c;\u9700\u8981\u8003\u8651 \u65e5\u5fd7&#xff0c;\u5f02\u5e38&#xff0c;\u53ef\u914d\u7f6e\u6027<\/p>\n<h3>\u65e5\u5fd7<\/h3>\n<p>logback:<br \/>\n  rolling policy:<br \/>\n    file-name-pattern: &#034;datemeta.%d{yyyy-MM-dd}.%i.log&#034;<br \/>\n    max-history: 10<br \/>\n    max-file-size: 1000KB<br \/>\n    total-size-cap: 20000KB <\/p>\n<h3>\u5f02\u5e38<\/h3>\n<p>\u81ea\u5b9a\u4e49\u5f02\u5e38\u53ca\u679a\u4e3e\u5f02\u5e38\u7684\u7c7b\u578b<\/p>\n<p>public enum DbMetaErrorCode {<br \/>\n    \/\/ \u6587\u4ef6\u76f8\u5173\u9519\u8bef<br \/>\n    CONFIG_FILE_NOT_FOUND(1001, &#034;\u914d\u7f6e\u6587\u4ef6\u672a\u627e\u5230: {0}&#034;),<br \/>\n    CONFIG_PARSE_ERROR(1002, &#034;\u914d\u7f6e\u6587\u4ef6\u89e3\u6790\u5931\u8d25: {0}&#034;),<\/p>\n<p>    \/\/ \u914d\u7f6e\u9a8c\u8bc1\u9519\u8bef<br \/>\n    DUPLICATE_DATA_INSTANCE(2001, &#034;\u53d1\u73b0\u91cd\u590d\u7684\u6570\u636e\u6e90\u5b9e\u4f8b\u540d\u79f0: {0}&#034;),<br \/>\n    MISSING_DATA_INSTANCE_NAME(2002, &#034;\u6570\u636e\u6e90\u5b9e\u4f8b\u7f3a\u5c11\u6709\u6548\u7684 dbinstancename&#034;),<br \/>\n    INVALID_DATASOURCE_URL(2003, &#034;{0}: URL\u65e0\u6548&#034;),<br \/>\n    MISSING_DRIVER_CLASS(2004, &#034;{0}: \u7f3a\u5c11\u9a71\u52a8\u7c7b\u540d&#034;),<br \/>\n    INVALID_KEEPDAYS(2005, &#034;\u4fdd\u7559\u5929\u6570\u65e0\u6548, \u5fc5\u987b\u5728{0}-{1}\u4e4b\u95f4, \u5f53\u524d\u503c: {2}&#034;),<br \/>\n    MISSING_DEST_DATASOURCE(2006, &#034;\u76ee\u6807\u6570\u636e\u6e90\u914d\u7f6e\u7f3a\u5931&#034;),<br \/>\n    MISSING_DEST_URL(2007, &#034;\u76ee\u6807\u6570\u636e\u6e90URL\u7f3a\u5931&#034;),<br \/>\n    MISSING_DEST_DRIVER(2008, &#034;\u76ee\u6807\u6570\u636e\u6e90\u9a71\u52a8\u7c7b\u540d\u7f3a\u5931&#034;),<\/p>\n<p>    \/\/ \u7cfb\u7edf\u9519\u8bef<br \/>\n    SYSTEM_STARTUP_FAILED(5001, &#034;\u7cfb\u7edf\u542f\u52a8\u5931\u8d25&#034;),<br \/>\n    DATABASE_CONNECTION_FAILED(5002, &#034;\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25: {0}&#034;),<\/p>\n<p>    \/\/ \u901a\u7528\u9519\u8bef<br \/>\n    INVALID_CONFIG(6001, &#034;\u914d\u7f6e\u65e0\u6548: {0}&#034;);<\/p>\n<p>    private final int code;<br \/>\n    private final String messageTemplate;<\/p>\n<p>    DbMetaErrorCode(int code, String messageTemplate) {<br \/>\n        this.code &#061; code;<br \/>\n        this.messageTemplate &#061; messageTemplate;<br \/>\n    }<\/p>\n<p>    public int getCode() {<br \/>\n        return code;<br \/>\n    }<\/p>\n<p>    public String getMessage(Object&#8230; params) {<br \/>\n        return MessageFormat.format(messageTemplate, params);<br \/>\n    }<br \/>\n} <\/p>\n<h3>\u914d\u7f6e\u5316<\/h3>\n<p>\u539f\u59cb\u6570\u636e\u5e93\u7684\u8fde\u63a5&#xff0c;\u914d\u7f6e\u5316<\/p>\n<p>\u76ee\u6807\u6570\u636e\u5e93\u7684\u8fde\u63a5&#xff0c;\u914d\u7f6e\u5316<\/p>\n<\/p>\n<h2 style=\"background-color:transparent\">\u7528\u6237\u7684\u4f7f\u7528\u65b9\u5f0f<\/h2>\n<p>\u672c\u673a\u5177\u6709jdk8\u4ee5\u4e0a\u73af\u5883<\/p>\n<p>\u67093\u4e2a\u6587\u4ef6&#xff0c;\u5c06\u8fd93\u4e2a\u6587\u4ef6&#xff0c;\u590d\u5236\u5230\u540c\u4e00\u4e2a\u76ee\u5f55\u4e0b\u3002\u8be5\u76ee\u5f55\u4e0d\u8981\u4f7f\u7528\u4e2d\u6587\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"105\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250616062848-684fb9a0d0320.png\" width=\"649\" \/><\/p>\n<h3 style=\"background-color:transparent\">\u6570\u636e\u6e90\u914d\u7f6econfig.xml<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"753\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250616062848-684fb9a0dd9de.png\" width=\"1122\" \/><\/p>\n<p>\u5b57\u6bb5\u89e3\u91ca<\/p>\n<p>keepdays&#xff1a;\u5728\u6570\u636e\u5e93\u4e2d\u4fdd\u7559\u7684\u8868\u7684\u5143\u6570\u636e\u5386\u53f2\u7248\u672c\u5929\u6570<\/p>\n<p>&lt;sourcedatasource&gt; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u662f\u9488\u5bf9\u539f\u59cb\u7684\u6570\u636e\u5e93\u5b9e\u4f8b\u7684\u76ee\u5f55<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0datainstance\u662f\u6570\u636e\u5e93\u7684\u5b9e\u4f8b&#xff0c;\u53ef\u4ee5\u6709\u591a\u4e2a\u5b9e\u4f8b&#xff0c;\u5982A&#xff0c;B&#xff0c;C\u7b49<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6570\u636e\u5e93\u5b9e\u4f8b\u4e2d\u6709\u591a\u4e2a\u6570\u636e\u5e93&#xff0c;\u4ec5\u9009\u62e9\u4efb\u610f\u4e00\u4e2a\u6570\u636e\u5e93&#xff0c;\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u8bbf\u95ee\u8be5\u5b9e\u4f8b\u4e2d\u6240\u6709\u7684\u5143\u6570\u636e\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5982&#xff0c;\u6570\u636e\u5e93\u67095\u4e2a\u5b9e\u4f8b&#xff0c;ABCDE&#xff0c;\u6bcf\u4e2a\u5b9e\u4f8b\u4e0b\u6709100\u4e2a\u5e93\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u90a3\u4e48\u5728 \u9700\u8981\u914d\u7f6e datainstance 5\u4e2a\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u6bcf\u4e2a\u91cc\u9762\u7684\u539f\u59cb\u9009\u62e9\u8be5 datainstance\u4e0b\u4efb\u610f\u4e00\u4e2a\u6570\u636e\u5e93\u7684driveclass&#xff0c; url&#xff0c;password<\/p>\n<p>&lt;destinationdatasource&gt; <\/p>\n<p>\u8fd9\u4e2a\u662f\u5c06\u7ed3\u679c\u7684\u5143\u6570\u636e\u5b58\u5165\u7684\u6570\u636e\u5e93&#xff1b;\u7edf\u8ba1\u7684\u6570\u636e\u4f1a\u88ab\u6267\u884c\u5230\u8be5\u6570\u636e\u5e93\u4e2d&#xff0c;<\/p>\n<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5728xml\u4e2d\u914d\u7f6e\u8fde\u63a5\u7684\u65f6\u5019&#xff0c;\u5982\u679c\u51fa\u73b0\u7279\u6b8a\u5b57\u7b26&#xff0c;\u9700\u8981\u8fdb\u884c\u8f6c\u4e49\u3002\u5982&amp; \u5b57\u7b26\u9700\u8981\u8f6c\u6362\u4e3a&amp;amp,<\/p>\n<p>&lt;destinationdatasource&gt;<br \/>\n        &lt;driverclassname&gt;com.mysql.cj.jdbc.Driver&lt;\/driverclassname&gt;<br \/>\n        &lt;url&gt;jdbc:mysql:\/\/localhost:3306\/speed?useUnicode&#061;true&amp;amp;characterEncoding&#061;utf-8&amp;amp;useSSL&#061;false&amp;amp;serverTimezone&#061;Asia\/Shanghai&lt;\/url&gt;<br \/>\n        &lt;username&gt;root&lt;\/username&gt;<br \/>\n        &lt;password&gt;Steven&#064;123&lt;\/password&gt;<br \/>\n        &lt;note&gt;\u76ee\u6807\u6570\u636e\u5e93&lt;\/note&gt;<br \/>\n    &lt;\/destinationdatasource&gt; <\/p>\n<h3>\u76ee\u6807\u6570\u636e\u5e93\u4e0bsql\u8bed\u53e5\u6267\u884c<\/h3>\n<p>CREATE TABLE &#096;tablemetainfo&#096; (<br \/>\n  &#096;id&#096; bigint NOT NULL,<br \/>\n  &#096;codecreateUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codecreateTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codeversion&#096; int DEFAULT NULL,<br \/>\n  &#096;dbinstancename&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;note&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableCatalog&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableSchema&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableName&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableType&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;engine&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;version&#096; int DEFAULT NULL,<br \/>\n  &#096;rowFormat&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableRows&#096; bigint DEFAULT NULL,<br \/>\n  &#096;avgRowLength&#096; bigint DEFAULT NULL,<br \/>\n  &#096;dataLength&#096; bigint DEFAULT NULL,<br \/>\n  &#096;maxDataLength&#096; bigint DEFAULT NULL,<br \/>\n  &#096;indexLength&#096; bigint DEFAULT NULL,<br \/>\n  &#096;dataFree&#096; bigint DEFAULT NULL,<br \/>\n  &#096;autoIncrement&#096; bigint DEFAULT NULL,<br \/>\n  &#096;createTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;updateTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;checkTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;tableCollation&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;checksum&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;createOptions&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableComment&#096; varchar(255) DEFAULT NULL,<br \/>\n  PRIMARY KEY (&#096;id&#096;)<br \/>\n) ENGINE&#061;InnoDB DEFAULT CHARSET&#061;utf8mb4 COLLATE&#061;utf8mb4_0900_ai_ci;<\/p>\n<p>CREATE TABLE &#096;columnmetainfo&#096; (<br \/>\n  &#096;id&#096; bigint NOT NULL,<br \/>\n  &#096;codecreateUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codecreateTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codeversion&#096; int DEFAULT NULL,<br \/>\n  &#096;dbname&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;note&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableCatalog&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableSchema&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tableName&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;columnName&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;ordinalPosition&#096; int NOT NULL,<br \/>\n  &#096;columnDefault&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;isNullable&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;dataType&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;numericPrecision&#096; int DEFAULT NULL,<br \/>\n  &#096;numericScale&#096; int DEFAULT NULL,<br \/>\n  &#096;datetimePrecision&#096; int DEFAULT NULL,<br \/>\n  &#096;characterSetName&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;collationName&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;columnType&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;columnKey&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;extra&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;privileges&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;columnComment&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;generationExpression&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;srsId&#096; varchar(255) DEFAULT NULL,<br \/>\n  PRIMARY KEY (&#096;id&#096;)<br \/>\n) ENGINE&#061;InnoDB DEFAULT CHARSET&#061;utf8mb4 COLLATE&#061;utf8mb4_0900_ai_ci;<\/p>\n<p>CREATE TABLE &#096;logdto&#096; (<br \/>\n  &#096;id&#096; bigint NOT NULL,<br \/>\n  &#096;codecreateUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codecreateTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedUserId&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;codelastModifiedTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;codeversion&#096; int DEFAULT NULL,<br \/>\n  &#096;logContent&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;logType&#096; int DEFAULT NULL,<br \/>\n  &#096;operateType&#096; int DEFAULT NULL,<br \/>\n  &#096;createBy&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;createTime&#096; datetime(6) DEFAULT NULL,<br \/>\n  &#096;costTime&#096; bigint DEFAULT NULL,<br \/>\n  &#096;ip&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;requestParam&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;requestType&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;requestUrl&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;method&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;username&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;userid&#096; varchar(255) DEFAULT NULL,<br \/>\n  &#096;tenantId&#096; int DEFAULT NULL,<br \/>\n  &#096;clientType&#096; varchar(255) DEFAULT NULL,<br \/>\n  PRIMARY KEY (&#096;id&#096;)<br \/>\n) ENGINE&#061;InnoDB DEFAULT CHARSET&#061;utf8mb4 COLLATE&#061;utf8mb4_0900_ai_ci; <\/p>\n<h3 style=\"background-color:transparent\">\u8fd0\u884c\u7a0b\u5e8f<\/h3>\n<p>\u57283\u4e2a\u6587\u4ef6\u7684\u76ee\u5f55\u4e0b&#xff0c;\u8fdb\u5165dos\u7684\u754c\u9762&#xff0c;\u6267\u884c<\/p>\n<p>java -jar .\\\\dbmeta-1.0.1.jar&#xff1b;\u5c06\u81ea\u52a8\u90e8\u7f72\u4e00\u4e2aweb\u670d\u52a1\u7a0b\u5e8f<\/p>\n<h3>\u83b7\u53d6\u8868\u7684\u5143\u6570\u636e<\/h3>\n<h4>\u7528\u6237\u624b\u52a8\u89e6\u53d1\u8bbf\u95ee<\/h4>\n<p>\u8fd9\u4e2a\u662f\u83b7\u53d6\u5230\u6700\u65b0\u7684\u8868\u7684\u5143\u6570\u636e\u3002<\/p>\n<p>http:\/\/127.0.0.1:8066\/tabledatainfo<\/p>\n<\/p>\n<h4>\u81ea\u52a8\u5b9a\u65f6\u4efb\u52a1<\/h4>\n<p>\/\/ \u6bcf\u5929\u51cc\u66685\u70b9\u6267\u884c&#xff0c;cron \u8868\u8fbe\u5f0f&#xff1a;0 0 5 * * ?<br \/>\n&#064;Scheduled(cron &#061; &#034;0 0 5 * * ?&#034;)<\/p>\n<p>\u6bcf\u6b21\u6267\u884c\u7684\u65f6\u5019&#xff0c;\u628a\u4eca\u5929\u7684\u6570\u636e\u5148\u8fdb\u884c\u5220\u9664&#xff0c;\u7136\u540e\u628a60\u5929\u7684\u6570\u636e\u5220\u9664&#xff0c;\u7136\u540e\u5728\u63d2\u5165\u672c\u6b21\u83b7\u53d6\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<h3>\u83b7\u53d6\u5217\u7684\u5143\u6570\u636e<\/h3>\n<p>\u00a0\u8fd9\u4e2a\u662f\u83b7\u53d6\u5230\u6700\u65b0\u7684\u5217\u7684\u5143\u6570\u636e<\/p>\n<p>http:\/\/127.0.0.1:8066\/columndatainfo<\/p>\n<p>\u5217\u6bcf\u6b21\u624b\u52a8\u66f4\u65b0&#xff0c;\u6ca1\u6709\u5fc5\u8981\u5b9a\u65f6\u4efb\u52a1<\/p>\n<\/p>\n<h2>\u6570\u636e\u5206\u6790<\/h2>\n<p>SELECT \u00a0\u00a0 \u00a0dbinstancename, \u00a0\u00a0 \u00a0tableSchema, \u00a0\u00a0 \u00a0tablename,( \u00a0\u00a0 \u00a0max( tablerows )- min( tablerows )) maxmindiff\u00a0 FROM \u00a0\u00a0 \u00a0tableinfo\u00a0 GROUP BY \u00a0\u00a0 \u00a0dbinstancename, \u00a0\u00a0 \u00a0tableSchema, \u00a0\u00a0 \u00a0tablename\u00a0 HAVING \u00a0\u00a0 \u00a0max( tablerows )- min( tablerows )&gt;10<\/p>\n<p>\u5047\u8bbe\u00a0 \u00a0\u6700\u5927\u503c-\u6700\u5c0f\u503c&#061;10&#xff0c;\u4e3a\u66f4\u65b0\u9891\u7387\u9ad8\u7684\u6807\u8bb0\u3002<\/p>\n<p>\u4ece\u8fd9\u4e2a\u7ed3\u679c\u96c6\u4e2d&#xff0c;\u53ef\u4ee5\u521d\u6b65\u8bc4\u4f30\u6709\u54ea\u4e9b\u662f\u9ad8\u9891\u66f4\u65b0&#xff0c;\u54ea\u4e9b\u662f\u4f4e\u9891\u66f4\u65b0\u3002<\/p>\n<\/p>\n<p>\u8fd9\u79cd\u8bc4\u4f30\u65b9\u6cd5\u5bf9\u4e8e\u5728ods\u4e2d\u6ca1\u6709\u66f4\u65b0\u65f6\u95f4\u7684\u6765\u770b&#xff0c;\u662f\u53ef\u53c2\u8003\u7684\u3002<\/p>\n<p>\u6700\u7406\u60f3\u7684\u65b9\u5f0f&#xff0c;\u662f\u5728ODS\u7684\u540c\u6b65\u65f6\u5019&#xff0c;\u540c\u65f6\u9700\u8981\u540c\u6b65 updatetime\u7684\u65f6\u95f4<\/p>\n<\/p>\n<p>\u5f00\u6e90\u7684\u4ee3\u7801\u5730\u5740<\/p>\n<p>https:\/\/gitee.com\/stevenworkshop_admin\/dbmeta<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb480\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6570\u636e\u5904\u7406\u7684\u89c4\u8303\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u5c42\u6b21\u662fODS\uff0c\u4e00\u822c\u6210\u4e3a\u8d34\u5143\u5c42\uff0c\u6700\u9760\u8fd1\u4e1a\u52a1\u5e93\u7684\u6570\u636e\u3002\u9700\u8981\u7edf\u8ba1ODS\u4e2d\u6709\u6570\u636e\u8868\u7684\u884c\u6570\uff0c\u53ca\u66f4\u65b0\u9891\u7387\u3002\uff08\u5047\u8bbe\u5728ODS\u4e2d\u662fMysql\u6570\u636e\u5e93\uff09<\/p>\n","protected":false},"author":2,"featured_media":44027,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[100],"topic":[],"class_list":["post-44029","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/44029.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb480\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6570\u636e\u5904\u7406\u7684\u89c4\u8303\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u5c42\u6b21\u662fODS\uff0c\u4e00\u822c\u6210\u4e3a\u8d34\u5143\u5c42\uff0c\u6700\u9760\u8fd1\u4e1a\u52a1\u5e93\u7684\u6570\u636e\u3002\u9700\u8981\u7edf\u8ba1ODS\u4e2d\u6709\u6570\u636e\u8868\u7684\u884c\u6570\uff0c\u53ca\u66f4\u65b0\u9891\u7387\u3002\uff08\u5047\u8bbe\u5728ODS\u4e2d\u662fMysql\u6570\u636e\u5e93\uff09\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/44029.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-16T06:28:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250616062848-684fb9a0d0320.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/44029.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/44029.html\",\"name\":\"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-16T06:28:50+00:00\",\"dateModified\":\"2025-06-16T06:28:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/44029.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/44029.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/44029.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/44029.html","og_locale":"zh_CN","og_type":"article","og_title":"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb480\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u6570\u636e\u5904\u7406\u7684\u89c4\u8303\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u5c42\u6b21\u662fODS\uff0c\u4e00\u822c\u6210\u4e3a\u8d34\u5143\u5c42\uff0c\u6700\u9760\u8fd1\u4e1a\u52a1\u5e93\u7684\u6570\u636e\u3002\u9700\u8981\u7edf\u8ba1ODS\u4e2d\u6709\u6570\u636e\u8868\u7684\u884c\u6570\uff0c\u53ca\u66f4\u65b0\u9891\u7387\u3002\uff08\u5047\u8bbe\u5728ODS\u4e2d\u662fMysql\u6570\u636e\u5e93\uff09","og_url":"https:\/\/www.wsisp.com\/helps\/44029.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-16T06:28:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250616062848-684fb9a0d0320.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/44029.html","url":"https:\/\/www.wsisp.com\/helps\/44029.html","name":"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-16T06:28:50+00:00","dateModified":"2025-06-16T06:28:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/44029.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/44029.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/44029.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SpringJPA\u7edf\u8ba1\u6570\u636e\u5e93\u8868\u884c\u6570\u53ca\u66f4\u65b0\u9891\u7387"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/44029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=44029"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/44029\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/44027"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=44029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=44029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=44029"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=44029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}