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!