Skip to content

Commit

Permalink
build: 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Feb 7, 2023
1 parent 10f752e commit e02df31
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

本插件打包了以下版本的数据库驱动和连接池

* `com.mysql:mysql-connector-j:8.0.32` - [mysql](example/mysql.hibernate.properties)
* `org.xerial:sqlite-jdbc:3.40.0.0` - [sqlite](example/sqlite.hibernate.properties)
* `org.postgresql:postgresql:42.5.1` - [postgresql](example/postgresql.hibernate.properties)
* `com.h2database:h2:2.1.214` - [h2](example/h2.hibernate.properties)
* `com.microsoft.sqlserver:mssql-jdbc:11.2.3.jre11` - [sqlserver](example/sqlserver.hibernate.properties)
* `com.mysql:mysql-connector-j:8.0.32` - [mysql.hibernate.properties](example/mysql.hibernate.properties)
* `org.xerial:sqlite-jdbc:3.40.0.0` - [sqlite.hibernate.properties](example/sqlite.hibernate.properties)
* `org.postgresql:postgresql:42.5.1` - [postgresql.hibernate.properties](example/postgresql.hibernate.properties)
* `com.h2database:h2:2.1.214` - [h2.hibernate.properties](example/h2.hibernate.properties)
* `com.microsoft.sqlserver:mssql-jdbc:11.2.3.jre11` - [sqlserver.hibernate.properties](example/sqlserver.hibernate.properties)
* `com.zaxxer:HikariCP:5.0.1`

需要其他数据库驱动或连接池支持,请添加 `plugin-shared-libraries` 依赖,有2种方法
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "xyz.cssxsh.mirai"
version = "2.6.0"
version = "2.6.1"

mavenCentralPublish {
useCentralS01()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class MiraiHibernateConfiguration(private val loader: MiraiHibernateLoade
* @see org.hibernate.dialect.H2Dialect
* @see org.hibernate.dialect.PostgreSQLDialect
* @see org.hibernate.dialect.SQLServerDialect
* @see org.hibernate.dialect.OracleDialect
* @see org.hibernate.community.dialect.SQLiteDialect
*/
private fun load() {
Expand Down Expand Up @@ -92,6 +93,9 @@ public class MiraiHibernateConfiguration(private val loader: MiraiHibernateLoade
setPropertyIfAbsent("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect")
setPropertyIfAbsent("hibernate.globally_quoted_identifiers", "true")
}
url.startsWith("jdbc:oracle") -> {
setPropertyIfAbsent("hibernate.dialect", "org.hibernate.dialect.OracleDialect")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal object MiraiHibernatePlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin",
name = "mirai-hibernate-plugin",
version = "2.6.0",
version = "2.6.1",
) {
author("cssxsh")

Expand Down Expand Up @@ -65,7 +65,7 @@ internal object MiraiHibernatePlugin : KotlinPlugin(

for (plugin in PluginManager.plugins) {
if (plugin !is JvmPlugin) continue
when (plugin.id) {
when (plugin.description.id) {
"net.mamoe.mirai-api-http" -> {
logger.info { "如果要使用 mirai-hibernate-plugin 为 mirai-api-http 提供消息持久化, 请安装 https://github.com/cssxsh/mirai-hibernate-http " }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public fun dialects(): Set<Class<out Dialect>> {
@PublishedApi
internal fun mssql(): String {
val java = System.getProperty("java.version")
val version = System.getProperty("xyz.cssxsh.mirai.hibernate.mssql.version", "12.2.0")
val version = System.getProperty("xyz.cssxsh.mirai.hibernate.mssql.version", "11.2.3")
return when {
java.startsWith("17") -> "com.microsoft.sqlserver:mssql-jdbc:${version}.jre17"
java.startsWith("11") -> "com.microsoft.sqlserver:mssql-jdbc:${version}.jre11"
Expand Down

0 comments on commit e02df31

Please sign in to comment.