1
mirror of https://github.com/CarmJos/EasyPlugin.git synced 2024-09-19 19:25:45 +00:00

[v1.2.0] 版本更新

- [U] 采用新版本EasySQL,快捷操作数据库,优雅永不过时。
- [A] 针对DatabaseTable添加数个快捷操作的方式。
This commit is contained in:
Carm Jos 2022-01-08 01:02:27 +08:00
parent 024efc7690
commit 80042aead7
13 changed files with 197 additions and 90 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -32,10 +32,10 @@
</developer>
</developers>
<licenses>
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
@ -51,34 +51,14 @@
<dependencies>
<!--通过 bom 快捷导入所有相关模块-->
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-common</artifactId>
<artifactId>easyplugin-bom</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-lp</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-placeholderapi</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-vault</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

107
easyplugin-bom/pom.xml Normal file
View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>easyplugin-bom</artifactId>
<packaging>pom</packaging>
<name>00-EasyPlugin-Bom</name>
<description>轻松插件汇总导入模块,允许快捷导入相关的接口并避免版本不一致问题。</description>
<url>https://github.com/CarmJos/EasyPlugin</url>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-main</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-configuration</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-command</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-database</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-gui</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-placeholderapi</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-vault</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-lp</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-main</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-configuration</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-database</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-gui</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-command</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-placeholderapi</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-vault</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-lp</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -34,8 +34,8 @@
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
@ -50,40 +50,31 @@
</ciManagement>
<dependencies>
<!--通过 bom 快捷导入所有相关模块-->
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-main</artifactId>
<artifactId>easyplugin-bom</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>cc.carm.lib</groupId>
<artifactId>easyplugin-placeholderapi</artifactId>
</exclusion>
<exclusion>
<groupId>cc.carm.lib</groupId>
<artifactId>easyplugin-lp</artifactId>
</exclusion>
<exclusion>
<groupId>cc.carm.lib</groupId>
<artifactId>easyplugin-vault</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-command</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-configuration</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-gui</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyplugin-database</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -33,10 +33,10 @@
</developer>
</developers>
<licenses>
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -32,10 +32,10 @@
</developer>
</developers>
<licenses>
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
@ -54,7 +54,7 @@
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-beecp</artifactId>
<version>0.2.5</version>
<version>0.2.6</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>

View File

@ -1,8 +1,9 @@
package cc.carm.lib.easyplugin.database;
import cc.carm.lib.easysql.api.SQLManager;
import cc.carm.lib.easysql.api.builder.TableCreateBuilder;
import cc.carm.lib.easysql.api.builder.TableQueryBuilder;
import cc.carm.lib.easysql.api.action.PreparedSQLUpdateAction;
import cc.carm.lib.easysql.api.action.PreparedSQLUpdateBatchAction;
import cc.carm.lib.easysql.api.builder.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -19,7 +20,8 @@ public class DatabaseTable {
this(tableName, columns, null);
}
public DatabaseTable(@NotNull String tableName, @NotNull String[] columns, @Nullable String tableSettings) {
public DatabaseTable(@NotNull String tableName, @NotNull String[] columns,
@Nullable String tableSettings) {
this.tableName = tableName;
this.columns = columns;
this.tableSettings = tableSettings;
@ -45,7 +47,31 @@ public class DatabaseTable {
}
public TableQueryBuilder createQuery(SQLManager sqlManager) {
return sqlManager.createQuery().inTable(tableName);
return sqlManager.createQuery().inTable(getTableName());
}
public DeleteBuilder createDelete(SQLManager sqlManager) {
return sqlManager.createDelete(getTableName());
}
public UpdateBuilder createUpdate(SQLManager sqlManager) {
return sqlManager.createUpdate(getTableName());
}
public InsertBuilder<PreparedSQLUpdateAction> createInsert(SQLManager sqlManager) {
return sqlManager.createInsert(getTableName());
}
public InsertBuilder<PreparedSQLUpdateBatchAction> createInsertBatch(SQLManager sqlManager) {
return sqlManager.createInsertBatch(getTableName());
}
public ReplaceBuilder<PreparedSQLUpdateAction> createReplace(SQLManager sqlManager) {
return sqlManager.createReplace(getTableName());
}
public ReplaceBuilder<PreparedSQLUpdateBatchAction> createReplaceBatch(SQLManager sqlManager) {
return sqlManager.createReplaceBatch(getTableName());
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -32,10 +32,10 @@
</developer>
</developers>
<licenses>
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -33,10 +33,10 @@
</developer>
</developers>
<licenses>
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>easyplugin-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.1.3</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

15
pom.xml
View File

@ -14,8 +14,13 @@
<groupId>cc.carm.lib</groupId>
<artifactId>easyplugin-parent</artifactId>
<packaging>pom</packaging>
<version>1.1.3</version>
<version>1.2.0</version>
<modules>
<module>easyplugin-bom</module>
<module>easyplugin-all</module>
<module>easyplugin-common</module>
<module>easyplugin-main</module>
<module>easyplugin-database</module>
@ -25,10 +30,8 @@
<module>easyplugin-vault</module>
<module>easyplugin-placeholderapi</module>
<module>easyplugin-all</module>
<module>easyplugin-common</module>
<module>easyplugin-lp</module>
</modules>
<name>EasyPlugin</name>
@ -46,8 +49,8 @@
<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<name>The MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>