JPA Annotated/Persistent Class


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package deng.myhibernatejpa;
  2.  
  3. import javax.persistence.*;
  4.  
  5. @Table(name="category")
  6. public class Category {
  7. @Id
  8. @GeneratedValue
  9. @Column(name="id")
  10. private Short id;
  11.  
  12. @Column(name="name")
  13. private String name;
  14.  
  15. public Short getId() {
  16. return id;
  17. }
  18.  
  19. public void setId(Short id) {
  20. this.id = id;
  21. }
  22.  
  23. public String getName() {
  24. return name;
  25. }
  26.  
  27. public void setName(String name) {
  28. this.name = name;
  29. }
  30.  
  31. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.