How to work with advanced JPA mappings?
Composite Keys with @IdClass
@IdClass@Entity
@IdClass(BookAuthor.BookAuthorId::class)
class BookAuthor(
@Id
val authorId: Long,
) {
@Id
@ManyToOne
lateinit var book: Book
// ...
}val query = jpql {
select(
path(Author::authorId),
).from(
entity(Author::class),
join(BookAuthor::class).on(path(Author::authorId).equal(path(BookAuthor::authorId))),
)
}Entity Inheritance
Embedded IDs and Embeddable Types
PreviousHow to sort by DTO fields or aliases?NextWhy is there a support module that only has a nullable return type
Last updated