-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42125e0
commit cba3c59
Showing
8 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "cq-sdk"] | ||
path = cq-sdk | ||
url = https://github.com/KurenaiRyu/cq-sdk.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
rootProject.name = "im-sync-bot" | ||
include(":cq-sdk") | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/main/kotlin/kurenai/imsyncbot/repository/UserConfigRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/kotlin/kurenai/imsyncbot/UserConfigRepositoryTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package kurenai.imsyncbot | ||
|
||
import jakarta.persistence.EntityGraph | ||
import jakarta.persistence.EntityManager | ||
import kurenai.imsyncbot.domain.UserConfig | ||
import org.junit.jupiter.api.Test | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
|
||
@SpringBootTest | ||
class UserConfigRepositoryTest { | ||
|
||
@Autowired | ||
private lateinit var em: EntityManager | ||
|
||
@Test | ||
fun test() { | ||
val entityGraph: EntityGraph<*>? = em.getEntityGraph("user") | ||
val cb = em.criteriaBuilder | ||
val criteriaQuery = cb.createQuery() | ||
val root = criteriaQuery.from(UserConfig::class.java) | ||
val typedQuery = | ||
em.createQuery(criteriaQuery.where(cb.equal(root.get<String>(UserConfig.Fields.bindingName), "kurenai"))) | ||
typedQuery.setHint("jakarta.persistence.fetchgraph", entityGraph).resultList as List<UserConfig> | ||
} | ||
} |