2 * In Samsung Ukraine R&D Center (SRK under a contract between)
3 * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4 * Copyright (C) 2017 Samsung Electronics Co., Ltd. All rights reserved.
6 package com.samsung.commons.domain;
8 import org.hibernate.annotations.Type;
10 import javax.persistence.*;
13 * <h1>Report DAO table</h1> DAO representation of Report class. Reports are
14 * send by client TV to TDM Server in ASIS format.
16 * @author <A HREF="mailto:a.motchanyi@samsung.com">Artem Motchanyi</A>
20 * @brief Report DAO table
21 * @date Created : 1/9/2016
22 * @date Modified : 11/2/2017
25 @Table(name = "report")
28 /** The unique ID in database table. */
30 @SequenceGenerator(name = "report_id_seq", sequenceName = "report_id_seq", allocationSize = 1)
31 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "report_id_seq")
35 /** The report type. */
37 @JoinColumn(name = "type_id", nullable = false)
38 private ReportType type;
43 private String report;
46 * ID of the client TV, so server is able to associate Report with concrete
50 @JoinColumn(name = "device_id", nullable = false)
51 private Device device;
54 * Report generation date
60 * Report verdict, 0 - ok, others - error code
63 private Integer result;
66 * Instantiates a new report.
72 * Instantiates a new report.
74 * @param type Report type.
75 * @param report The {@link String} with report body.
76 * @param date The report generation date
77 * @param result Report verdict
78 * @param device The {@link Device} ID of client TV, so server is able to associate Report with concrete registered client TV.
80 public Report(ReportType type, String report, String date, Integer result, Device device) {
100 * @param id the new id
102 public void setId(Long id) {
107 * Gets the report type.
109 * @return {@link ReportType}
111 public ReportType getType() {
118 * @param type the new {@link ReportType}
120 public void setType(ReportType type) {
129 public String getReport() {
134 * Sets the report contents.
136 * @param report the new report string
138 public void setReport(String report) {
139 this.report = report;
145 * @return {@link Device}
147 public Device getDevice() {
154 * @param device the new {@link Device}
156 public void setDevice(Device device) {
157 this.device = device;
161 * Gets report generation date
163 * @return report generation date
165 public String getDate() {
170 * Sets report generation date
172 * @param date report generation date
174 public void setDate(String date) {
179 * Gets report verdict
181 * @return report verdict
183 public Integer getResult() {
188 * Sets report verdict
190 * @param result the result
192 public void setResult(Integer result) {
193 this.result = result;
197 * Method provides reflection to print names and values of all fields
198 * <em>declared in this class</em>. Note that superclass fields are left out
199 * of this implementation.
201 * @return String with names and values of all fields declared in this
205 public String toString() {
206 return "Report [id=" + id + ", type=" + type + ", report=" + report + ", device=" + device + "]";