Bill.java

张创琦

  1. package com.zcq.entity;
  2. import javax.persistence.*;
  3. import java.io.Serializable;
  4. import java.util.Date;
  5. @Table(name = "bill_")
  6. public class Bill implements Serializable {
  7. @Id
  8. @GeneratedValue(strategy = GenerationType.IDENTITY)
  9. @Column(name = "id_")
  10. private Long id;
  11. @Column(name= "title_")
  12. private String title;
  13. @Column(name = "bill_time_")
  14. private Date billTime;
  15. @Column(name = "type_id_")
  16. private Long typeId;
  17. @Column(name = "price_")
  18. private Double price;
  19. @Column(name = "explain_")
  20. private String explain;
  21. // @Transient注解表示当前属性为瞬时属性,跟字段没有映射
  22. // 类别名称
  23. @Transient
  24. private String typeName;
  25. // 开始时间:用于查询
  26. @Transient
  27. private Date date1;
  28. // 结束时间:用于查询
  29. @Transient
  30. private Date date2;
  31. @Override
  32. public String toString() {
  33. return "Bill{" +
  34. "id=" + id +
  35. ", title='" + title + '\'' +
  36. ", billTime=" + billTime +
  37. ", typeId=" + typeId +
  38. ", price=" + price +
  39. ", explain='" + explain + '\'' +
  40. ", typeName='" + typeName + '\'' +
  41. ", date1=" + date1 +
  42. ", date2=" + date2 +
  43. '}';
  44. }
  45. public Long getId() {
  46. return id;
  47. }
  48. public void setId(Long id) {
  49. this.id = id;
  50. }
  51. public String getTitle() {
  52. return title;
  53. }
  54. public void setTitle(String title) {
  55. this.title = title;
  56. }
  57. public Date getBillTime() {
  58. return billTime;
  59. }
  60. public void setBillTime(Date billTime) {
  61. this.billTime = billTime;
  62. }
  63. public Long getTypeId() {
  64. return typeId;
  65. }
  66. public void setTypeId(Long typeId) {
  67. this.typeId = typeId;
  68. }
  69. public Double getPrice() {
  70. return price;
  71. }
  72. public void setPrice(Double price) {
  73. this.price = price;
  74. }
  75. public String getExplain() {
  76. return explain;
  77. }
  78. public void setExplain(String explain) {
  79. this.explain = explain;
  80. }
  81. public String getTypeName() {
  82. return typeName;
  83. }
  84. public void setTypeName(String typeName) {
  85. this.typeName = typeName;
  86. }
  87. public Date getDate1() {
  88. return date1;
  89. }
  90. public void setDate1(Date date1) {
  91. this.date1 = date1;
  92. }
  93. public Date getDate2() {
  94. return date2;
  95. }
  96. public void setDate2(Date date2) {
  97. this.date2 = date2;
  98. }
  99. }