Skip to content

Commit 78154c4

Browse files
committed
Oracle与SQL Server的分页
1 parent fe19d7c commit 78154c4

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/main/java/com/zzg/mybatis/generator/bridge/MybatisGeneratorBridge.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ public void generate() throws Exception {
140140
// limit/offset插件
141141
if (generatorConfig.isOffsetLimit()) {
142142
PluginConfiguration pluginConfiguration = new PluginConfiguration();
143-
pluginConfiguration.addProperty("type", "com.zzg.mybatis.generator.plugins.MySQLLimitPlugin");
144-
pluginConfiguration.setConfigurationType("com.zzg.mybatis.generator.plugins.MySQLLimitPlugin");
143+
if (DbType.MySQL.name().equals(selectedDatabaseConfig.getDbType())
144+
|| DbType.PostgreSQL.name().equals(selectedDatabaseConfig.getDbType())) {
145+
pluginConfiguration.addProperty("type", "com.zzg.mybatis.generator.plugins.MySQLLimitPlugin");
146+
pluginConfiguration.setConfigurationType("com.zzg.mybatis.generator.plugins.MySQLLimitPlugin");
147+
}
145148
context.addPluginConfiguration(pluginConfiguration);
146149
}
147150
context.setTargetRuntime("MyBatis3");

src/main/resources/fxml/MainUI.fxml

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
<ColumnConstraints hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="170.0" />
5555
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="688.0" minWidth="74.0" prefWidth="76.0" />
5656
<ColumnConstraints hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="166.0" />
57-
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="111.0" />
58-
<ColumnConstraints hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="116.0" />
57+
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="129.0" />
58+
<ColumnConstraints hgrow="SOMETIMES" maxWidth="688.0" minWidth="10.0" prefWidth="95.0" />
5959
</columnConstraints>
6060
<rowConstraints>
6161
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
@@ -75,7 +75,7 @@
7575
<Insets left="5.0" right="5.0" />
7676
</GridPane.margin>
7777
</TextField>
78-
<Label text="Java POJO 类名" GridPane.rowIndex="1" />
78+
<Label text="Java实体类名" GridPane.rowIndex="1" />
7979
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="1" GridPane.valignment="CENTER">
8080
<children>
8181
<TextField fx:id="domainObjectNameField" prefHeight="27.0" prefWidth="154.0" promptText="Person" GridPane.columnIndex="1" GridPane.rowIndex="2">
@@ -128,7 +128,7 @@
128128
</styleClass></Button>
129129
</children>
130130
</HBox>
131-
<Label text="Java POJO包名" GridPane.rowIndex="4" />
131+
<Label text="实体类名包名" GridPane.rowIndex="4" />
132132
<TextField fx:id="modelTargetPackage" prefHeight="27.0" prefWidth="152.0" promptText="com.example.model" GridPane.columnIndex="1" GridPane.rowIndex="4">
133133
<HBox.margin>
134134
<Insets right="5.0" />
@@ -142,7 +142,7 @@
142142
<GridPane.margin>
143143
<Insets left="5.0" />
144144
</GridPane.margin></TextField>
145-
<Label text="DAO接口包名" GridPane.rowIndex="5" />
145+
<Label text="接口包名" GridPane.rowIndex="5" />
146146
<TextField fx:id="daoTargetPackage" prefHeight="27.0" prefWidth="248.0" promptText="com.example.mapper" GridPane.columnIndex="1" GridPane.rowIndex="5">
147147
<HBox.margin>
148148
<Insets right="5.0" />
@@ -156,7 +156,7 @@
156156
<GridPane.margin>
157157
<Insets left="5.0" />
158158
</GridPane.margin></TextField>
159-
<Label text="映射文件包名" GridPane.rowIndex="6" />
159+
<Label text="映射XML文件包名" GridPane.rowIndex="6" />
160160
<TextField fx:id="mapperTargetPackage" prefHeight="27.0" prefWidth="248.0" promptText="com.example" GridPane.columnIndex="1" GridPane.rowIndex="6">
161161
<HBox.margin>
162162
<Insets right="5.0" />
@@ -203,7 +203,7 @@
203203
</styleClass></Button>
204204
</children>
205205
</HBox>
206-
<Label text="DAO名称(选填)" GridPane.columnIndex="4" GridPane.rowIndex="5">
206+
<Label text="自定义接口名称(选填)" GridPane.columnIndex="4" GridPane.rowIndex="5">
207207
<padding>
208208
<Insets left="5.0" />
209209
</padding>

0 commit comments

Comments
 (0)