使用ClosedRange<T>
我知道四处走动是使用@Entity
或@Embeddable
创建自己的Range类,
但没有其他解决方案?
例外:
org.hibernate.MappingException: Could not determine type for: kotlin.ranges.IntRange, at table: Foo, for columns: [org.hibernate.mapping.Column(myRange)]
实体:
@Entity
class Foo (
@Id @GeneratedValue var id: Long? = null,
var myRange: IntRange = 0..0
)
答案 0 :(得分:0)
@Entity
data Foo (
@Id @GeneratedValue var id: Int? = null,
var target: IntRange = target in 0..100
)