我有以下 Java 集合,
List<Map<String, Object>>
我编写了一个自定义转换器类,它可以将其扁平化为 MyEntity
列表(其中 MyEntity
基本上是 String、Value、Java 类型,父集合)并将其重新组装回一个 Map,但我想知道……
是否可以注释该列表,以便 Hibernate 可以保留这些映射的列表?我简要查看了 collectionOfElements
注释,我知道由于 Hibernate 需要转换为有效的数据库类型,因此 Object 值会出现问题。
任何想法都感激不尽:)
I have the following Java Collection
List<Map<String, Object>>
I've written a custom converter class which can flatten this down to a List of MyEntity
(where MyEntity
is basically String, Value, Java type, parent collection) and re-assemble it back to a Map but I was wondering......
Is it possible to annotate the List such that Hibernate can persist a List of these Maps? I've had a brief look at the collectionOfElements
annotation and I know there will be problems with the Object value due to Hibernate needed to convert to a valid database type.
Any ideas gratefully received :)
发布评论