Is there an equivalent annotation in the collection-type collection in Hibernate?

In Hibernate, you can define the type of a custom collection by setting the "collection type" attribute in the xibernate xml mapping file.

I was wondering if there is an equivalent to annotation.

PS: I tried using @Type, but hibernate complains:

"Illegal attempt to map a non collection as a @OneToMany, @ManyToMany" ... 

So, I assume that @Type is for regular properties only.

Thanks!

+4
source share
1 answer

When this question was made, there was no such annotation. Since HHH-4417 is fixed in version 4.1.1, there is org.hibernate.annotations.CollectionType . Although I do not know if it works with the specified EventList collection.

+3
source

Source: https://habr.com/ru/post/1338905/


All Articles