当试图坚持 ComparableSet
使用自定义可比较类型localdaytimerange:
ComparableSet<LocalDayTimeRange> timeRanges = new ComparableSet<>();
LocalDayTimeRange sundayRange = new LocalDayTimeRange(
LocalDayTimeRange.DAY.SUNDAY,
LocalTime.parse("01:00"),
LocalTime.parse("23:00"));
LocalDayTimeRange mondayRange = new LocalDayTimeRange(
LocalDayTimeRange.DAY.MONDAY,
LocalTime.parse("07:00"),
LocalTime.parse("08:00"));
它抛出以下错误:
jetbrains.exodus.ExodusException: Unsupported Comparable value type: class com.myapp.properties.LocalDayTimeRange
at jetbrains.exodus.bindings.ComparableValueType.getPredefinedType(ComparableValueType.java:91)
at jetbrains.exodus.bindings.ComparableSetBinding.writeObject(ComparableSetBinding.java:59)
at jetbrains.exodus.entitystore.tables.PropertyTypes.writePropertyValue(PropertyTypes.java:120)
at jetbrains.exodus.entitystore.tables.PropertyTypes.propertyValueToEntry(PropertyTypes.java:109)
at jetbrains.exodus.entitystore.PersistentEntityStoreImpl.setProperty(PersistentEntityStoreImpl.java:868)
at jetbrains.exodus.entitystore.PersistentEntity.setProperty(PersistentEntity.java:120)
鉴于,其注册:
entityStore.executeInTransaction(txn -> {
((PersistentEntityStore) txn.getStore()).registerCustomPropertyType(
txn, LocalDayTimeRange.class, LocalDayTimeRangeBinding.BINDING);
})
我的设置有什么问题?
暂无答案!
目前还没有任何答案,快来回答吧!