Skip to content

Commit

Permalink
chore(example): spring boot version v3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Sep 21, 2023
1 parent 04e4894 commit da226fa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import jakarta.persistence.EmbeddedId
import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.OneToMany
import jakarta.persistence.OneToOne
import jakarta.persistence.Table
import java.time.OffsetDateTime
import java.util.*
Expand Down Expand Up @@ -43,12 +42,12 @@ class Book(
@OneToMany(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val authors: MutableSet<BookAuthor>,

@OneToOne(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val publisher: BookPublisher,
@OneToMany(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val publishers: MutableSet<BookPublisher>,
) {
init {
authors.forEach { it.book = this }
publisher.book = this
publishers.forEach { it.book = this }
}

override fun equals(other: Any?): Boolean = Objects.equals(isbn, (other as? Book)?.isbn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.IdClass
import jakarta.persistence.JoinColumn
import jakarta.persistence.OneToOne
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import java.io.Serializable
import java.util.*
Expand All @@ -22,7 +22,7 @@ class BookPublisher(
val publisherId: Long,
) {
@Id
@OneToOne
@ManyToOne
@JoinColumn(name = "isbn")
lateinit var book: Book

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class BatchExampleTest : WithAssertions {
entity(Book::class),
).from(
entity(Book::class),
fetchJoin(Book::publisher),
fetchJoin(Book::publishers),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import jakarta.persistence.EmbeddedId
import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.OneToMany
import jakarta.persistence.OneToOne
import jakarta.persistence.Table
import java.time.OffsetDateTime
import java.util.*
Expand Down Expand Up @@ -43,12 +42,12 @@ class Book(
@OneToMany(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val authors: MutableSet<BookAuthor>,

@OneToOne(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val publisher: BookPublisher,
@OneToMany(mappedBy = "book", cascade = [CascadeType.ALL], orphanRemoval = true)
val publishers: MutableSet<BookPublisher>,
) {
init {
authors.forEach { it.book = this }
publisher.book = this
publishers.forEach { it.book = this }
}

override fun equals(other: Any?): Boolean = Objects.equals(isbn, (other as? Book)?.isbn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.IdClass
import jakarta.persistence.JoinColumn
import jakarta.persistence.OneToOne
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import java.io.Serializable
import java.util.*
Expand All @@ -22,7 +22,7 @@ class BookPublisher(
val publisherId: Long,
) {
@Id
@OneToOne
@ManyToOne
@JoinColumn(name = "isbn")
lateinit var book: Book

Expand Down
2 changes: 1 addition & 1 deletion libs.example.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.9.10"

spring-boot3 = "3.1.3"
spring-boot3 = "3.1.4"
spring-boot2 = "2.7.16"

[libraries]
Expand Down

0 comments on commit da226fa

Please sign in to comment.