/trunk/ zonejavastudy --username ypz168/JPATest_Hibernate01/src/com/yan/dev/jpa/bean/User.java

https://gitlab.com/BGCX261/zonejavastudy-svn-to-git · Java · 69 lines · 32 code · 11 blank · 26 comment · 0 complexity · 118753a193acc6a6a59a4ed48fa3d5ac MD5 · raw file

  1. /**
  2. * Copyright(c) 2010-2011 Yan.Dev. All Rights Reserved.
  3. */
  4. package com.yan.dev.jpa.bean;
  5. import javax.persistence.Entity;
  6. import javax.persistence.GeneratedValue;
  7. import javax.persistence.Id;
  8. import javax.persistence.Table;
  9. import static javax.persistence.GenerationType.IDENTITY;
  10. ;
  11. /**
  12. * Comment for User.java
  13. *
  14. * @author <a href="mailto:yan.dev@hotmail.com">yan.dev</a>
  15. *
  16. * @blog:<a href="http://yan-dev.javaeye.com"><b>yan.dev's Blog</b></a>
  17. * @version 1.0
  18. * @time 2011-3-25 ÉÏÎç11:37:12
  19. */
  20. @Entity
  21. @Table(name = "yan_dev")
  22. public class User {
  23. private int id;
  24. private String name;
  25. public User() {
  26. }
  27. public User(String name) {
  28. this.name = name;
  29. }
  30. /**
  31. * @return the id
  32. */
  33. @Id
  34. @GeneratedValue(strategy = IDENTITY)
  35. public int getId() {
  36. return id;
  37. }
  38. /**
  39. * @param id
  40. * the id to set
  41. */
  42. public void setId(int id) {
  43. this.id = id;
  44. }
  45. /**
  46. * @return the name
  47. */
  48. public String getName() {
  49. return name;
  50. }
  51. /**
  52. * @param name
  53. * the name to set
  54. */
  55. public void setName(String name) {
  56. this.name = name;
  57. }
  58. }