package ee.bcs.andmed.jaagup; import javax.persistence.*; import java.util.*; @Entity @Table(name="kodanikud") public class Kodanik { @Id @Column public int id; @Basic @Column public String eesnimi; @ManyToMany(cascade=CascadeType.ALL) @JoinTable( name="kodanikud_telefonid", joinColumns={@JoinColumn(name="kodaniku_id")}, inverseJoinColumns={@JoinColumn(name="telefoni_id")}) Set numbrid=new HashSet(); }