I am using MySQL database.
In my table i there are two four primary keys, out of which one is auto incremented.
@Embeddable
public class Employee
You're missing a @GeneratedValue at the id
field.
Depending on its values, you're free to choose a strategy for generation, like a sequences, id tables, an automatic internal id generation.
Last but not least GenerationType.AUTO will choose one of the mentioned strategies.
See the Javadocs for javax.persistence.GeneratedValue
and javax.persistence.GenerationType
.