Bogdan
Bogdan

Reputation: 5406

Is there a "collection-type" equivalent annotation in Hibernate?

In Hibernate you can define a custom collection type by setting the "collection-type" attribute in hibernate xml mapping file.

I was wondering if there is an annotation equivalent.

PS: I tried using @Type but hibernate complains:

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

So I assume @Type is just for regular properties.

Thanks!

Upvotes: 4

Views: 1752

Answers (1)

Mikko Maunu
Mikko Maunu

Reputation: 42114

When this question was made there was no such an annotation. Since HHH-4417 is fixed in version 4.1.1 there is org.hibernate.annotations.CollectionType. Though I don't know does it work with mentioned EventList collection.

Upvotes: 3

Related Questions