-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
When using an inline value class as a column type, Hibernate thinks that the type is the wrapper primitive, whereas Yawn thinks that the type is the value class. This leads to class cast exceptions when Hibernate tries to cast the value class to the primitive.
Yawn should recognize inline value class column types and apply special handling to unwrap their primitive at query compilation time
To reproduce the issue:
@JvmInline
value class InternationalStandardBookNumber(val isbn: String)
@Entity
@Table(name = "books")
@YawnEntity
class Book {
// ...
@Column
lateinit var isbn: InternationalStandardBookNumber
}
session.createYawnCriteria(BookTable) { books ->
addEq(isbn, InternationalStandardBookNumber("123"))
}.uniqueResult()Note that it seems to specifically only happen for String value classes. At least, I cannot reproduce with an Int value class, which requires me to bind a converter, but I can with a String one, which doesn't require me to bind a converter and doesn't work even if I do bind one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels