0

I have simple entity class (irrelevant methods omitted):

@Entity
@Table(name="CONNECTIONS")
public class Connection implements Serializable {
      @Id private Long id_track;
      @Id private Long id_carrier;
      @Id private Date date_out;                       
      @Id private Time time_out;        
      private Date date_in;
      private Time time_in;
      private Double price;
      ...
}

I expect that JPA (in my case Eclipse implementation) creates TABLE CONNETIONS with composite primary key that consists of id_track, id_carrier, date_out and time_out columns but it adds addidional column id (of type integer) What do I do wrong?

biera
  • 2,608
  • 1
  • 24
  • 26

1 Answers1

0

I can not reproduce this. Are you sure JPA is creating your table? Also ensure you have recompiled and redeployed your code.

Perhaps enable logging, and include what JPA provider and version you are using.

Are you using Glassfish?

James
  • 17,965
  • 11
  • 91
  • 146
  • Yes, the container is Glassfish. As I mentioned above I'm using Eclipse implementation of JPA. I'm sure about recompiling and redeploying. – biera Sep 24 '12 at 12:07