AccessionIpr.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 java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.genesys.blocks.model.Copyable;
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 = "accession_ipr")
@JsonIdentityInfo(scope = AccessionIpr.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@Getter
@Setter
@NoArgsConstructor
public class AccessionIpr extends CooperatorOwnedModel implements Copyable<AccessionIpr> {
private static final long serialVersionUID = 96253871118732230L;
/** Accession IPR ID. */
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "accession_ipr_id", columnDefinition = "int")
private Long id;
/** Accession: Reference to the accession described by this IPR record. */
@NotNull @ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "accession_id", nullable = false)
private Accession accession;
/** IPR Type: Type of intellectual property rights associated with the accession. Uses ACCESSION_RESTRICTION_TYPE vocabulary. */
@Basic
@NotNull @Column(name = "type_code", nullable = false, length = CODE_VALUE_LENGTH)
@CodeValueField("ACCESSION_RESTRICTION_TYPE")
private String typeCode;
/** IPR Crop Name: Crop name for the accession the IPR is associated with. */
@Basic
@Size(max = 100) @Column(name = "ipr_crop_name", length = 100)
private String iprCropName;
/** IPR Full Name: Name of the patent or property right listed on the IPR document. */
@Basic
@Size(max = 2000) @Column(name = "ipr_full_name", length = 2000)
private String iprFullName;
/** IPR Number: Numeric identifier for the IPR. */
@Basic
@Size(max = 50) @Column(name = "ipr_number", length = 50)
private String iprNumber;
/** Cooperator: Reference to the cooperator associated with this IPR record. */
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "cooperator_id")
private Cooperator cooperator;
/** Accepted Date: Date when the registration number was assigned and the manuscript officially accepted for publication. */
@Basic
@Column(name = "accepted_date")
private Date acceptedDate;
/** Expected Date: Future expiration date of the protection. */
@Basic
@Column(name = "expected_date")
private Date expectedDate;
/** Issued Date: Date when the intellectual property rights were issued. */
@Basic
@Column(name = "issued_date")
private Date issuedDate;
/** Expired Date: Date when the intellectual property right or protection expired or was removed. */
@Basic
@Column(name = "expired_date")
private Date expiredDate;
/** Note: General comments. */
@Basic
@Column
@Lob
private String note;
public AccessionIpr(final Long id) {
this.id = id;
}
@Override
public void lazyLoad() {
super.lazyLoad();
lazyLoad(this.accession, true);
}
@Override
public boolean canEqual(Object other) {
return other instanceof AccessionIpr;
}
}