-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: UserCollectionType for guava collections - custom persister?
PostPosted: Sun Mar 02, 2014 1:27 pm 
Newbie

Joined: Fri Feb 14, 2014 11:16 am
Posts: 6
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.