我正在尝试将一个EnumSet
对象存储到我的 neo4j 数据库中。但是,我得到了这个例外:
org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.util.LinkedHashSet<?> to type java.util.EnumSet<?> for value '[READ, WRITE, OPTIONAL]'; nested exception is java.lang.IllegalArgumentException: Could not instantiate Collection type: java.util.EnumSet
EnumSet
有什么方法可以用其他东西代替 the吗?或者,有人知道解决方法吗?
我尝试将集合设置为HashSet
,但我失去了EnumSet
提供给我的方法,例如noneOf()
.