WebCooperator.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 javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.genesys.blocks.model.Copyable;
import org.gringlobal.custom.validation.javax.CodeValueField;
/**
* Auto-generated by:
* org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator
*/
@Entity
@Table(name = "web_cooperator")
@Getter
@Setter
@NoArgsConstructor
public class WebCooperator extends WebOwnedModel implements Copyable<WebCooperator> {
private static final long serialVersionUID = -2202597526298955823L;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "web_cooperator_id", columnDefinition = "int")
private Long id;
@Basic
@Size(max = 100)
@Column(name = "address_line1", length = 100)
private String addressLine1;
@Basic
@Size(max = 100)
@Column(name = "address_line2", length = 100)
private String addressLine2;
@Basic
@Size(max = 100)
@Column(name = "address_line3", length = 100)
private String addressLine3;
@Basic
@Size(max = 4)
@Column(name = "category_code", length = 4)
@CodeValueField("COOPERATOR_CATEGORY")
private String categoryCode;
@Basic
@Size(max = 100)
@Column(length = 100)
private String city;
@Basic
@Size(max = 50)
@Column(length = 50)
private String discipline;
@Basic
@Size(max = 100)
@Column(length = 100)
private String email;
@Basic
@Size(max = 30)
@Column(length = 30)
private String fax;
@Basic
@Size(max = 100)
@Column(name = "first_name", length = 100)
private String firstName;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "geography_id")
@JsonIgnoreProperties(value = { "ownedBy" })
private Geography geography;
@Basic
@Size(max = 10)
@Column(length = 10)
private String initials;
@Basic
@NotNull
@Size(min = 1, max = 1)
@Column(name = "is_active", nullable = false, length = 1)
private String isActive;
@Basic
@Size(max = 100)
@Column(length = 100)
private String job;
@Basic
@Size(max = 100)
@Column(name = "last_name", length = 100)
private String lastName;
@Basic
@Column
@Lob
private String note;
@Basic
@Size(max = 200)
@Column(length = 200)
private String organization;
@Basic
@Size(max = 10)
@Column(name = "organization_code", length = 10)
private String organizationCode;
@Basic
@Size(max = 20)
@Column(name = "organization_region", length = 20)
private String organizationRegion;
@Basic
@Size(max = 100)
@Column(name = "postal_index", length = 100)
private String postalIndex;
@Basic
@Size(max = 30)
@Column(name = "primary_phone", length = 30)
private String primaryPhone;
@Basic
@Size(max = 30)
@Column(name = "secondary_phone", length = 30)
private String secondaryPhone;
@Basic
@Size(max = 10)
@Column(length = 10)
private String title;
public WebCooperator(final Long id) {
this.id = id;
}
@Override
public boolean canEqual(Object other) {
return other instanceof WebCooperator;
}
}