OrderRequestPhytoLog.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.gringlobal.custom.validation.javax.CodeValueField;

import static org.gringlobal.model.community.CommunityCodeValues.CODE_VALUE_LENGTH;

/**
 * Auto-generated by:
 * org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator
 */
@Entity
@Table(name = "order_request_phyto_log")
@JsonIdentityInfo(scope = OrderRequestPhytoLog.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@Getter
@Setter
@NoArgsConstructor
public class OrderRequestPhytoLog extends CooperatorOwnedModel {

	private static final long serialVersionUID = -269338884768254525L;

	@Basic
	@Column(name = "certificate_cost")
	private Integer certificateCost;

	@Basic
	@Column(length = 1)
	private String delivered;

	@Basic
	@Column(name = "delivered_date")
	private Date deliveredDate;

	@Id
	@JsonProperty
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "order_request_phyto_log_id", columnDefinition = "int")
	private Long id;

	@Basic
	@Column(name = "import_permit_identifier", length = 60)
	private String importPermitIdentifier;

	@ManyToOne(fetch = FetchType.LAZY, cascade = {})
	@JoinColumn(name = "inspected_by_cooperator_id")
	private Cooperator inspectedByCooperator;

	@Basic
	@Column(name = "inspected_date")
	private Date inspectedDate;

	@Basic
	@Column(name = "major_genus", length = 100)
	private String majorGenus;

	@Basic
	@Column
	@Lob
	private String note;

	@Basic
	@Column(name = "number_of_items")
	private Integer numberOfItems;

	@Basic
	@Column(name = "number_of_packages", length = 20)
	private String numberOfPackages;

	@Basic
	@Column(name = "opened_date")
	private Date openedDate;

	@ManyToOne(fetch = FetchType.LAZY, cascade = {})
	@JoinColumn(name = "order_request_id", nullable = false)
	private OrderRequest orderRequest;

	@Basic
	@Column(name = "passed_inspection", length = 1)
	private String passedInspection;

	@Basic
	@Column(name = "phyto_certificate_identifier", length = 60)
	private String phytoCertificateIdentifier;

	@Basic
	@Column(name = "phyto_certificate_type_code", length = CODE_VALUE_LENGTH)
	@CodeValueField("PHYTO_CERT_TYPE")
	private String phytoCertificateTypeCode;

	@Basic
	@Column(name = "received_date", nullable = false)
	private Date receivedDate;

	@Basic
	@Column(name = "setup_inspection_date")
	private Date setupInspectionDate;

	@Basic
	@Column(name = "shipped_date")
	private Date shippedDate;

	@Basic
	@Column(name = "shipping_carrier", length = 60)
	private String shippingCarrier;

	@Basic
	@Column(name = "tracking_identifier", length = 100)
	private String trackingIdentifier;

	public OrderRequestPhytoLog(final Long id) {
		this.id = id;
	}

	@Override
	public boolean canEqual(Object other) {
		return other instanceof OrderRequestPhytoLog;
	}
}