Skip to content

Instantly share code, notes, and snippets.

@ryanzhou7
Last active July 9, 2018 23:30
Show Gist options
  • Save ryanzhou7/c3fbb40f68b1f8d7394767a83d335031 to your computer and use it in GitHub Desktop.
Save ryanzhou7/c3fbb40f68b1f8d7394767a83d335031 to your computer and use it in GitHub Desktop.
package hello;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity // This tells Hibernate to make a table out of this class
public class User {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
private String name;
private String email;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
//Getter/Setters for rest of fields, etc...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment