I am new to hibernate and how annotations can create tables in database. I think what is wanted is related with : this question, but I am not sure
Suppose there is a class Ticket like this :
@Entity
public class Ticket {
@ManyToMany
private Set<Person> buyers;
@ManyToMany
private List<Person> collectors;
...
...
}
The below line creates a table ticket_person as wanted:
private Set<Person> buyers;
But the next line, again the class Person is used in object collectors, so table ticket_person can't be created again, but there is a need to have both objects buyers and collectors. So how to get round the problem ? Is there any way in which the default table name ticket_person can be overridden ? Or any other solution that lets create 2 tables with same fields but for different objects in the entity ?