@Entity@Table(name = "usr") // @Table is optional, but "user" is a keyword in many SQL variants public class User { @Id // @Id indicates that this it a unique primary key @GeneratedValue // @GeneratedValue indicates that value is automatically generated by the server private Long id;

@Column(length = 32, unique = true) // the optional @Column allows us makes sure that the name is limited to a suitable size and is unique private String name;

// note that no setter for ID is provided, Hibernate will generate the ID for us