I try to implement UserCollectionTypes for some of guavas additional collections (for now Multiset and Table) in hibernate 4.3.
I didn't find much information about how to implement a completely new collection type, just something about extending existing collections with custom implementations. Is it correct, that one needs to implement UserCollectionType, PersistentCollection (extending AbstractPersistentCollection seems appropriate) and a custom CollectionPersister (maybe extending AbstractCollectionPersister)? I didn't find a way to specify a default persister for a UserCollectionType. Is it necessary to annotate every occurrence of e. g. a Multiset with @Persister(impl = MultisetPersister.class) or is there a simpler way?
Edit: digging further in the code, it seems that CollectionBinder would throw an AnnotationException if it should persist a Multiset / Table, because it checks just (Sorted)Set, (Sorted)Map, Collection and List. Is it possible to persist guava collections at all?
|