我有简单的实体类(省略不相关的方法):
@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;
...
}
我希望 JPA(在我的例子中是 Eclipse 实现)使用由id_track、id_carrier、date_out和time_out列组成的复合主键创建表连接,但它添加了额外的列id(整数类型)我做错了什么?