-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to map a collection of UserType
PostPosted: Fri Jan 08, 2010 2:12 pm 
Newbie

Joined: Mon Sep 10, 2007 11:59 am
Posts: 3
Location: BA, Argentina
I have a custom user type (class extending org.hibernate.usertype.UserType) that handles the persistence of a Class of my domain (called InformacionPlugin) that is not mapped because their instances are loaded from an external resource (an XML). This UserType maps an "InformacionPlugin" to an INT field using an Id. This works perfectly, a hibernate mapped entity has a many-to-one relationship with an InformacionPlugin and it persists correctly.

Now I have a hibernate mapped class that has a many-to-many collection of "InformacionPlugin". I've tried this but its throwing
org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class:
Code:
   @CollectionOfElements
   @JoinTable(name = "conjuntos_configuracion", joinColumns = @JoinColumn(name = "id_configuracion"))
   @Column(name = "id_conjunto_atributos")
   @ManyToMany
   public Set<InformacionPlugin> getPlugins() {
      return this.plugins;
   }

I've also tryied using @Type but it still does not work.

Is there a way to map a collection of user types?
Thanks!


Top
 Profile  
 
 Post subject: Re: How to map a collection of UserType
PostPosted: Fri Aug 06, 2010 4:27 am 
Newbie

Joined: Wed Apr 23, 2008 8:19 am
Posts: 1
I have the same problem. I need to declare a custom UserType for the elements and not for the collection. How can this be done?


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

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.