hello ,sorry for my bad english :)
i will generate this 2 tables in picture with JPA but i don't know how to do a relation between tables
http://cl.ly/2k3A0l0J1K3N1U393g1hprieste to give me a solution
Class Client
Code:
@Entity
@Table(name="Client")
public class Client {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="numClient")
private Integer numClient;
@Column(name="nameClient")
private String nameClient;
@Column(name="adressClient")
private String adressClient;
@Column(name="phoneClient")
private String phoneclient;
public Integer getNumClient() {
return numClient;
}
Class Reservation
Code:
@Entity
@Table(name="Reservation")
public class Reservation {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="numReservation")
private Integer numChambre;
@Column(name="debutReservation")
@Temporal(TemporalType.DATE)
private Calendar debutReservation;
@Column(name="finReservation")
@Temporal(TemporalType.DATE)
private Calendar finReservation;
@Column(name="dateReservation")
@Temporal(TemporalType.DATE)
private Calendar datereservation;
@Column(name="prix")
private Double prix;
@Column(name="libelleReservation")
private String libelleReservation;
//@OneToMany(mappedBy="Reservation")
//private List<Client> ClientList;
}
its very urgent ty :)