1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| @Entity
@Table(name = "t_wilaya")
public class Wilaya implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String libeller;
private Collection<String> dairas;
private Map<Integer, String> communes;
/* *********Geteur and Setter******** */
@Id
@Column(name="code_wilaya", nullable = false)
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
@Column(nullable = false)
public String getLibeller() { return libeller; }
public void setLibeller(String libeller) { this.libeller = libeller; }
@ElementCollection
@CollectionTable(name = "t_daira")
@Column(name = "daira")
public Collection<String> getDairas() { return dairas; }
public void setDairas(Collection<String> dairas) { this.dairas = dairas; }
@ElementCollection
@CollectionTable(name="t_commune")
@MapKeyColumn (name = "code_commune")
@Column(name = "commune")
public Map<Integer, String> getCommunes() { return communes; }
public void setCommunes(Map<Integer, String> communes) { this.communes = communes; }
/* ******************************** */
} |
Partager