In this code, how to generate a Java class for the composite key (how to composite key in hibernate):
create table Time ( levelStation int(15) not null,
You need to use @EmbeddedId:
@Entity class Time { @EmbeddedId TimeId id; String src; String dst; Integer distance; Integer price; } @Embeddable class TimeId implements Serializable { Integer levelStation; Integer confPathID; }