Skip to content

Commit

Permalink
build: 2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Jul 12, 2022
1 parent 0ad3dc9 commit db4df64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ plugins {
}

group = "xyz.cssxsh.mirai"
version = "2.3.4"
version = "2.3.5"

mavenCentralPublish {
useCentralS01()
singleDevGithubProject("cssxsh", "mirai-hibernate-plugin")
licenseFromGitHubProject("AGPL-3.0", "master")
publication {
artifact(tasks.getByName("buildPlugin"))
artifact(tasks.getByName("buildPluginLegacy"))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public object MiraiHibernatePlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin",
name = "mirai-hibernate-plugin",
version = "2.3.4",
version = "2.3.5",
) {
author("cssxsh")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import net.mamoe.mirai.*
import net.mamoe.mirai.contact.*
import net.mamoe.mirai.message.code.*
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.*

@Entity
@Table(name = "message_record")
Expand Down Expand Up @@ -105,7 +106,7 @@ public data class MessageRecord(
return if (isNullOrEmpty()) {
IntArray(0)
} else {
splitToSequence(',').map { it.toInt() }.toMutableList().toIntArray()
split(',').mapToIntArray { it.toInt() }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ abstract class DatabaseTest {
session.withCriteria<MessageRecord> { criteria ->
val record = criteria.from<MessageRecord>()
val id = record.get<Long>("id")
val subquery = criteria.subquery<Long>()
val rand = dice(subquery.select(max(subquery.from<MessageRecord>().get("id"))))
val max = criteria.subquery<Long>().apply {
select(max(from<MessageRecord>().get("id")))
}

criteria.select(record)
.where(
ge(id, rand)
ge(id, dice(max))
)
}.setMaxResults(3).list()
}
Expand Down

0 comments on commit db4df64

Please sign in to comment.