We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


Posted By

thebugslayer on 09/23/07


Tagged

java jpa


Versions (?)


JPA Annotated/Persistent Class


Published in: Java 


  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 

You need to login to post a comment.