Hi,
I'm trying to persist a collection of value types. The problem is I want to handle the mapping myself. So how does one declare a collection of embeddables to use a custom UserType?
I have this:
Code:
@Entity
public class MyMessages {
@ElementCollection
@CollectionTable(name = "messages", joinColumns = @JoinColumn(name = "trade_message_id"))
//I want to be able to do something like this: @Type(type = "com.company.mytype")
private List<Message> messages;
}
Is this possible/ allowed? I've tried trawling through the forums and blogs without much success, so I would appreciate it if someone who knows more about this or has attempted this before, could shed some light on this matter.
Thanks,
Steven