2 * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 * not use this file except in compliance with the License. You may obtain
6 * a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 * implied. See the License for the specific language governing
14 * permissions and limitations under the License.
16 package org.akraino.validation.ui.entity;
18 import java.io.IOException;
19 import java.io.Serializable;
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.JoinColumn;
27 import javax.persistence.ManyToOne;
28 import javax.persistence.Table;
30 import com.fasterxml.jackson.core.JsonGenerator;
31 import com.fasterxml.jackson.databind.SerializerProvider;
32 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
33 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
36 @Table(name = "w_robot_test_result")
37 public class WRobotDbTestResult implements Serializable {
42 private static final long serialVersionUID = 1L;
45 @GeneratedValue(strategy = GenerationType.IDENTITY)
47 private int wRobotResultId;
49 @Column(name = "layer")
53 @JoinColumn(name = "validation_test_result_id")
54 @JsonSerialize(using = ValidationDbTestResultSerializer.class)
55 private ValidationDbTestResult validationDbTestResult;
57 @Column(name = "robot_test_results")
58 private String robotTestResults;
60 public int getWRobotResultId() {
61 return wRobotResultId;
64 public void setWRobotResultId(int wRobotResultId) {
65 this.wRobotResultId = wRobotResultId;
68 public String getLayer() {
72 public void setLayer(String layer) {
76 public ValidationDbTestResult getValidationDbTestResult() {
77 return validationDbTestResult;
80 public void setValidationDbTestResult(ValidationDbTestResult validationDbTestResult) {
81 this.validationDbTestResult = validationDbTestResult;
84 public String getRobotTestResults() {
85 return robotTestResults;
88 public void setRobotTestResults(String robotTestResults) {
89 this.robotTestResults = robotTestResults;
92 static class ValidationDbTestResultSerializer extends StdSerializer<ValidationDbTestResult> {
94 public ValidationDbTestResultSerializer() {
98 public ValidationDbTestResultSerializer(Class<ValidationDbTestResult> t) {
103 public void serialize(ValidationDbTestResult validationDbTestResult, JsonGenerator gen,
104 SerializerProvider provider) throws IOException {
105 gen.writeObject(null);