InventoryQualityStatus.java
/*
* Copyright 2019 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.model;
import java.util.Date;
import javax.persistence.*;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.genesys.blocks.model.Copyable;
import org.gringlobal.custom.validation.javax.CodeValueField;
import org.gringlobal.model.community.CommunityCodeValues;
import static org.gringlobal.model.community.CommunityCodeValues.CODE_VALUE_LENGTH;
/**
* Auto-generated by:
* org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator
*/
@Entity
@Table(name = "inventory_quality_status")
@JsonIdentityInfo(scope = InventoryQualityStatus.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@Getter
@Setter
@NoArgsConstructor
public class InventoryQualityStatus extends CooperatorOwnedModel implements Copyable<InventoryQualityStatus> {
private static final long serialVersionUID = 6439022184139987687L;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "inventory_quality_status_id", columnDefinition = "int")
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "inventory_id", nullable = false)
private Inventory inventory;
@Basic
@CodeValueField(CommunityCodeValues.PATHOLOGY_TEST)
@Column(name = "contaminant_code", nullable = false, length = CODE_VALUE_LENGTH)
private String contaminantCode;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "method_id")
private Method method;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "tester_cooperator_id")
private Cooperator testerCooperator;
@Basic
@Column(name = "completed_count")
private Integer completedCount;
@Basic
@Column(name = "completed_date")
private Date completedDate;
@Basic
@CodeValueField(CommunityCodeValues.DATE_FORMAT)
@Column(name = "completed_date_code", length = CODE_VALUE_LENGTH)
private String completedDateCode;
@Basic
@Column(name = "negative_control")
private Double negativeControl;
@Basic
@CodeValueField(CommunityCodeValues.GERMPLASM_FORM)
@Column(name = "plant_part_tested_code", length = CODE_VALUE_LENGTH)
private String plantPartTestedCode;
@Basic
@Column(name = "plate_or_assay_number", length = 40)
private String plateOrAssayNumber;
@Basic
@Column(name = "positive_control")
private Double positiveControl;
@Basic
private Integer replicate;
@Basic
@Column(name = "required_replication_count")
private Integer requiredReplicationCount;
@Basic
@Column(name = "started_count")
private Integer startedCount;
@Basic
@Column(name = "started_date")
private Date startedDate;
@Basic
@CodeValueField(CommunityCodeValues.DATE_FORMAT)
@Column(name = "started_date_code", length = CODE_VALUE_LENGTH)
private String startedDateCode;
@Basic
@CodeValueField(CommunityCodeValues.PATHOLOGY_TEST_RESULT)
@Column(name = "test_result_code", length = CODE_VALUE_LENGTH)
private String testResultCode;
@Basic
@Column(name = "test_results_score", length = 40)
private String testResultsScore;
@Basic
@CodeValueField(CommunityCodeValues.PATH_TEST_SCORE_TYPE)
@Column(name = "test_results_score_type_code", length = CODE_VALUE_LENGTH)
private String testResultsScoreTypeCode;
@Basic
@CodeValueField(CommunityCodeValues.PATHOLOGY_TEST_TYPE)
@Column(name = "test_type_code", nullable = false, length = CODE_VALUE_LENGTH)
private String testTypeCode;
@Basic
@Column
@Lob
private String note;
public InventoryQualityStatus(final Long id) {
this.id = id;
}
@Override
public void lazyLoad() {
super.lazyLoad();
lazyLoad(testerCooperator, false);
lazyLoad(method, false);
}
@Override
public boolean canEqual(Object other) {
return other instanceof InventoryQualityStatus;
}
}