-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: need help hibernate (JPA)
PostPosted: Fri Aug 19, 2011 10:04 pm 
Newbie

Joined: Fri Aug 19, 2011 8:21 pm
Posts: 3
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/2k3A0l0J1K3N1U393g1h



prieste 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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.