Ad.java 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. package com.qxgmat.data.dao.entity;
  2. import java.io.Serializable;
  3. import java.util.Date;
  4. import javax.persistence.*;
  5. @Table(name = "ad")
  6. public class Ad implements Serializable {
  7. @Id
  8. @Column(name = "`id`")
  9. @GeneratedValue(strategy = GenerationType.IDENTITY)
  10. private Integer id;
  11. /**
  12. * 广告标题
  13. */
  14. @Column(name = "`title`")
  15. private String title;
  16. /**
  17. * 频道页面
  18. */
  19. @Column(name = "`channel`")
  20. private String channel;
  21. /**
  22. * 位置
  23. */
  24. @Column(name = "`place`")
  25. private String place;
  26. /**
  27. * 广告图片
  28. */
  29. @Column(name = "`image`")
  30. private String image;
  31. /**
  32. * 广告位置
  33. */
  34. @Column(name = "`position`")
  35. private Integer position;
  36. /**
  37. * 广告链接
  38. */
  39. @Column(name = "`link`")
  40. private String link;
  41. /**
  42. * 开始时间
  43. */
  44. @Column(name = "`start_time`")
  45. private Date startTime;
  46. /**
  47. * 结束时间
  48. */
  49. @Column(name = "`end_time`")
  50. private Date endTime;
  51. private static final long serialVersionUID = 1L;
  52. /**
  53. * @return id
  54. */
  55. public Integer getId() {
  56. return id;
  57. }
  58. /**
  59. * @param id
  60. */
  61. public void setId(Integer id) {
  62. this.id = id;
  63. }
  64. /**
  65. * 获取广告标题
  66. *
  67. * @return title - 广告标题
  68. */
  69. public String getTitle() {
  70. return title;
  71. }
  72. /**
  73. * 设置广告标题
  74. *
  75. * @param title 广告标题
  76. */
  77. public void setTitle(String title) {
  78. this.title = title;
  79. }
  80. /**
  81. * 获取频道页面
  82. *
  83. * @return channel - 频道页面
  84. */
  85. public String getChannel() {
  86. return channel;
  87. }
  88. /**
  89. * 设置频道页面
  90. *
  91. * @param channel 频道页面
  92. */
  93. public void setChannel(String channel) {
  94. this.channel = channel;
  95. }
  96. /**
  97. * 获取位置
  98. *
  99. * @return place - 位置
  100. */
  101. public String getPlace() {
  102. return place;
  103. }
  104. /**
  105. * 设置位置
  106. *
  107. * @param place 位置
  108. */
  109. public void setPlace(String place) {
  110. this.place = place;
  111. }
  112. /**
  113. * 获取广告图片
  114. *
  115. * @return image - 广告图片
  116. */
  117. public String getImage() {
  118. return image;
  119. }
  120. /**
  121. * 设置广告图片
  122. *
  123. * @param image 广告图片
  124. */
  125. public void setImage(String image) {
  126. this.image = image;
  127. }
  128. /**
  129. * 获取广告位置
  130. *
  131. * @return position - 广告位置
  132. */
  133. public Integer getPosition() {
  134. return position;
  135. }
  136. /**
  137. * 设置广告位置
  138. *
  139. * @param position 广告位置
  140. */
  141. public void setPosition(Integer position) {
  142. this.position = position;
  143. }
  144. /**
  145. * 获取广告链接
  146. *
  147. * @return link - 广告链接
  148. */
  149. public String getLink() {
  150. return link;
  151. }
  152. /**
  153. * 设置广告链接
  154. *
  155. * @param link 广告链接
  156. */
  157. public void setLink(String link) {
  158. this.link = link;
  159. }
  160. /**
  161. * 获取开始时间
  162. *
  163. * @return start_time - 开始时间
  164. */
  165. public Date getStartTime() {
  166. return startTime;
  167. }
  168. /**
  169. * 设置开始时间
  170. *
  171. * @param startTime 开始时间
  172. */
  173. public void setStartTime(Date startTime) {
  174. this.startTime = startTime;
  175. }
  176. /**
  177. * 获取结束时间
  178. *
  179. * @return end_time - 结束时间
  180. */
  181. public Date getEndTime() {
  182. return endTime;
  183. }
  184. /**
  185. * 设置结束时间
  186. *
  187. * @param endTime 结束时间
  188. */
  189. public void setEndTime(Date endTime) {
  190. this.endTime = endTime;
  191. }
  192. @Override
  193. public String toString() {
  194. StringBuilder sb = new StringBuilder();
  195. sb.append(getClass().getSimpleName());
  196. sb.append(" [");
  197. sb.append("Hash = ").append(hashCode());
  198. sb.append(", id=").append(id);
  199. sb.append(", title=").append(title);
  200. sb.append(", channel=").append(channel);
  201. sb.append(", place=").append(place);
  202. sb.append(", image=").append(image);
  203. sb.append(", position=").append(position);
  204. sb.append(", link=").append(link);
  205. sb.append(", startTime=").append(startTime);
  206. sb.append(", endTime=").append(endTime);
  207. sb.append("]");
  208. return sb.toString();
  209. }
  210. public static Ad.Builder builder() {
  211. return new Ad.Builder();
  212. }
  213. public static class Builder {
  214. private Ad obj;
  215. public Builder() {
  216. this.obj = new Ad();
  217. }
  218. /**
  219. * @param id
  220. */
  221. public Builder id(Integer id) {
  222. obj.setId(id);
  223. return this;
  224. }
  225. /**
  226. * 设置广告标题
  227. *
  228. * @param title 广告标题
  229. */
  230. public Builder title(String title) {
  231. obj.setTitle(title);
  232. return this;
  233. }
  234. /**
  235. * 设置频道页面
  236. *
  237. * @param channel 频道页面
  238. */
  239. public Builder channel(String channel) {
  240. obj.setChannel(channel);
  241. return this;
  242. }
  243. /**
  244. * 设置位置
  245. *
  246. * @param place 位置
  247. */
  248. public Builder place(String place) {
  249. obj.setPlace(place);
  250. return this;
  251. }
  252. /**
  253. * 设置广告图片
  254. *
  255. * @param image 广告图片
  256. */
  257. public Builder image(String image) {
  258. obj.setImage(image);
  259. return this;
  260. }
  261. /**
  262. * 设置广告位置
  263. *
  264. * @param position 广告位置
  265. */
  266. public Builder position(Integer position) {
  267. obj.setPosition(position);
  268. return this;
  269. }
  270. /**
  271. * 设置广告链接
  272. *
  273. * @param link 广告链接
  274. */
  275. public Builder link(String link) {
  276. obj.setLink(link);
  277. return this;
  278. }
  279. /**
  280. * 设置开始时间
  281. *
  282. * @param startTime 开始时间
  283. */
  284. public Builder startTime(Date startTime) {
  285. obj.setStartTime(startTime);
  286. return this;
  287. }
  288. /**
  289. * 设置结束时间
  290. *
  291. * @param endTime 结束时间
  292. */
  293. public Builder endTime(Date endTime) {
  294. obj.setEndTime(endTime);
  295. return this;
  296. }
  297. public Ad build() {
  298. return this.obj;
  299. }
  300. }
  301. }