TaxonomyCwrMap.java
/*
* Copyright 2026 Global Crop Diversity Trust
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root folder or http://www.apache.org/licenses/LICENSE-2.0
*/
package org.gringlobal.model;
import static org.gringlobal.model.community.CommunityCodeValues.CODE_VALUE_LENGTH;
import javax.persistence.*;
import org.gringlobal.custom.validation.javax.CodeValueField;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Auto-generated by:
* org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator
*/
@Entity
@Table(name = "taxonomy_cwr_map")
@Getter
@Setter
@NoArgsConstructor
public class TaxonomyCwrMap extends CooperatorOwnedModel {
private static final long serialVersionUID = -1144239675462809416L;
/** Taxonomy CWR Map ID. */
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "taxonomy_cwr_map_id", columnDefinition = "int")
private Long id;
/** TaxonomyCwrCrop: Reference to the crop wild relative crop described by this taxonomy crop wild relative map. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "taxonomy_cwr_crop_id", nullable = false)
private TaxonomyCwrCrop taxonomyCwrCrop;
/** TaxonomySpecies: Reference to the taxon described by this taxonomy crop wild relative map. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "taxonomy_species_id", nullable = false)
private TaxonomySpecies taxonomySpecies;
/** Citation: Reference to the citation described by this taxonomy crop wild relative map. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "citation_id")
private Citation citation;
/** Crop Common Name: The common name for the crop and/or subcrops. */
@Basic
@Column(name = "crop_common_name", length = 100)
private String cropCommonName;
/** Genepool: The genepool relationship level. Uses CWR_GENEPOOL vocabulary. */
@Basic
@Column(name = "genepool_code", length = CODE_VALUE_LENGTH)
@CodeValueField("CWR_GENEPOOL")
private String genepoolCode;
/** Is Crop?: Whether the taxon is not just a relative. */
@Basic
@Column(name = "is_crop", nullable = false, length = 1)
private String isCrop;
/** Is Graftstock Genepool?: Whether the taxon is a graftstock. */
@Basic
@Column(name = "is_graftstock", nullable = false, length = 1)
private String isGraftstock;
/** Is Potential?: Whether the taxon is a potential relative or trait. */
@Basic
@Column(name = "is_potential", nullable = false, length = 1)
private String isPotential;
/** Note: Generic comments about the taxonomic crop wild relative. */
@Basic
@Lob
private String note;
public TaxonomyCwrMap(Long id) {
this.id = id;
}
@Override
public boolean canEqual(Object other) {
return other instanceof TaxonomyCropMap;
}
}