How do u map to custom collections using annnotations? Is there an example that I could look at?
I have a one-to-many relationship that looks like this.
Code:
private TaskList tasks;
@OneToMany(mappedBy = "template", cascade = {CascadeType.ALL}, targetEntity = TemplateTask.class)
public TaskList getTasks()
{
return tasks();
}
The TaskList class extends ArrayList to provide custom implemention to certain methods. So I want to map "tasks" above to TaskList instead of java.util.List. TaskList class signature looks like this..
Code:
public class TaskList<S> extends ArrayList implements UserCollectionType
{}
I have provided implementation for all methods in UserCollectionType here.
How should I instruct hibernate to map it to TaskList instead of ArrayList?
Thanks,