diff --git a/src/org/redkale/source/DataDefaultSource.java b/src/org/redkale/source/DataDefaultSource.java index cce8215ab..309625c82 100644 --- a/src/org/redkale/source/DataDefaultSource.java +++ b/src/org/redkale/source/DataDefaultSource.java @@ -360,24 +360,6 @@ public final class DataDefaultSource implements DataSource, Function infox = loadEntityInfo(t); - stmt = conn.createStatement(); - rs = stmt.executeQuery("SELECT MAX(" + info.getPrimarySQLColumn() + ") FROM " + infox.getTable()); // 必须是同一字段名 - if (rs.next()) { - if (primaryType == int.class) { - int v = rs.getInt(1) / info.allocationSize; - if (v > info.primaryValue.get()) info.primaryValue.set(v); - } else { - long v = rs.getLong(1) / info.allocationSize; - if (v > info.primaryValue.get()) info.primaryValue.set(v); - } - } - rs.close(); - stmt.close(); - } - } info.initedPrimaryValue = true; } } diff --git a/src/org/redkale/source/DistributeTables.java b/src/org/redkale/source/DistributeTables.java deleted file mode 100644 index a304a4bd0..000000000 --- a/src/org/redkale/source/DistributeTables.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.redkale.source; - -import java.lang.annotation.*; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * 当使用DistributeGenerator控制主键值时, 如果表A与表AHistory使用同一主键时, 就需要将表A的class标记: - *
- *  @DistributeTables({AHistory.class})
- *  public class A {
- *  }
- * 
- * 这样DistributeGenerator将从A、B表中取最大值来初始化主键值。 常见场景就是表B是数据表A对应的历史表 - * - *

- * 详情见: http://redkale.org - * - * @author zhangjx - */ -@Target({TYPE}) -@Retention(RUNTIME) -public @interface DistributeTables { - - Class[] value(); -} diff --git a/src/org/redkale/source/EntityInfo.java b/src/org/redkale/source/EntityInfo.java index 7e706b9c0..e76a2629e 100644 --- a/src/org/redkale/source/EntityInfo.java +++ b/src/org/redkale/source/EntityInfo.java @@ -83,8 +83,6 @@ public final class EntityInfo { //---------------------计算主键值---------------------------- private final int nodeid; - final Class[] distributeTables; - final boolean autoGenerated; final boolean distributed; @@ -129,8 +127,6 @@ public final class EntityInfo { this.source = source; //--------------------------------------------- this.nodeid = nodeid >= 0 ? nodeid : 0; - DistributeTables dt = type.getAnnotation(DistributeTables.class); - this.distributeTables = dt == null ? null : dt.value(); LogLevel ll = type.getAnnotation(LogLevel.class); this.logLevel = ll == null ? Integer.MIN_VALUE : Level.parse(ll.value()).intValue();