TaxonomyUse.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.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
/**
* Auto-generated by:
* org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator
*/
@Entity
@Table(name = "taxonomy_use")
@JsonIdentityInfo(scope = TaxonomyUse.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@Getter
@Setter
@NoArgsConstructor
public class TaxonomyUse extends CooperatorOwnedModel {
private static final long serialVersionUID = 3421418547516208503L;
/** Taxonomy Use ID. */
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "taxonomy_use_id", columnDefinition = "int")
private Long id;
/** Economic Use: The economic usage primary category from the International Working Group on Plant Taxonomic Databases (TDWG). Uses TAXONOMY_USAGE vocabulary. */
@Basic
@Column(name = "economic_usage_code", nullable = false, length = CODE_VALUE_LENGTH)
@CodeValueField("TAXONOMY_USAGE")
private String economicUsageCode;
/** TaxonomySpecies: Reference to the taxon described by this taxonomy use. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "taxonomy_species_id", nullable = false)
private TaxonomySpecies taxonomySpecies;
/** Citation: Reference to the citation described by this taxonomy use. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "citation_id")
private Citation citation;
/** Plant Part: Plant part used for the specified economic usage. Uses TAXONOMY_PLANT_PART vocabulary. */
@Basic
@Column(name = "plant_part_code", length = CODE_VALUE_LENGTH)
@CodeValueField("TAXONOMY_PLANT_PART")
private String plantPartCode;
/** Usage Type: The economic usage secondary category from the International Working Group on Plant Taxonomic Databases (TDWG). */
@Basic
@Column(name = "usage_type", length = 100)
private String usageType;
/** Note: General comments. */
@Basic
@Column
@Lob
private String note;
public TaxonomyUse(final Long id) {
this.id = id;
}
@Override
public boolean canEqual(Object other) {
return other instanceof TaxonomyUse;
}
}