import javax.persistence.*; import static javax.persistence.GenerationType.IDENTITY; @Entity @Table(name="koerad") public class Koer { @Id @GeneratedValue(strategy=IDENTITY) @Column(name="id", unique=true, nullable=false) public int id; @Basic @Column(name="koeranimi") public String koeranimi; @Basic @Column(name="synniaasta") public int synniaasta; }