我可以在Hibernate实体中使用ClosedRange <T>吗?

当使用ClosedRange<T>时,Hibernate抛出异常

我知道走动是使用@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 ) 

 @Entity data Foo ( @Id @GeneratedValue var id: Int? = null, var target: IntRange = target in 0..100 ) 
Interesting Posts