Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: seedlot columns and area of use #685

Merged
merged 6 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public class SeedlotGeneticWorth {
@Column(name = "genetic_quality_value", precision = 4, scale = 1, nullable = false)
private BigDecimal geneticQualityValue;

@Column(name = "tested_parent_tree_cont_pct", precision = 6, scale = 2)
private BigDecimal testedParentTreeContributionPercentage;

@Column(name = "estimated_ind")
Boolean estimated;

@Embedded @NonNull private AuditInformation auditInformation;

@Column(name = "revision_count", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package ca.bc.gov.backendstartapi.entity;

import ca.bc.gov.backendstartapi.entity.embeddable.AuditInformation;
import ca.bc.gov.backendstartapi.entity.seedlot.Seedlot;
import ca.bc.gov.backendstartapi.entity.seedlot.idclass.SeedlotSeedPlanZoneId;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/** This class represents a Seedlot Seed Plan Zone entity. */
@Entity
@Table(name = "seedlot_smp_mix")
@IdClass(SeedlotSeedPlanZoneId.class)
@NoArgsConstructor(access = AccessLevel.PACKAGE)
@RequiredArgsConstructor
@Getter
@Setter
public class SeedlotSeedPlanZoneEntity {

// region Identifier
@Id
@JoinColumn(name = "seedlot_number")
@ManyToOne
@NonNull
private Seedlot seedlot;

@Id
@Column(name = "seed_plan_zone_code", length = 3, nullable = false)
@NonNull
private String seedPlanZoneCode;

// endregion

@Embedded private AuditInformation auditInformation;

@Column(name = "revision_count", nullable = false)
@Version
@Setter(AccessLevel.NONE)
private int revisionCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public class Seedlot implements Serializable {
@Column(name = "interm_facility_code", length = 3)
private String interimStorageFacilityCode;

@Column(name = "interm_strg_locn", length = 55)
private String interimStorageLocationDescription;

// endregion

// region Orchard
Expand Down Expand Up @@ -159,12 +162,6 @@ public class Seedlot implements Serializable {
@Column(name = "effective_pop_size", precision = 5, scale = 1)
private BigDecimal effectivePopulationSize;

@Column(name = "tested_parent_tree_cont_pct", precision = 6, scale = 2)
private BigDecimal testedParentTreeContributionPercentage;

@Column(name = "coancestry", precision = 20, scale = 10)
private BigDecimal coancestry;

@Column(name = "smp_parents_outside")
private Integer parentsOutsideTheOrchardUsedInSmp;

Expand All @@ -186,16 +183,16 @@ public class Seedlot implements Serializable {
@Column(name = "extraction_end_date")
private LocalDateTime extractionEndDate;

@Column(name = "storage_client_number", length = 8)
@Column(name = "temporary_strg_client_number", length = 8)
private String storageClientNumber;

@Column(name = "storage_locn_code", length = 2)
@Column(name = "temporary_strg_locn_code", length = 2)
private String storageLocationCode;

@Column(name = "temporary_storage_start_date")
@Column(name = "temporary_strg_start_date")
private LocalDateTime temporaryStorageStartDate;

@Column(name = "temporary_storage_end_date")
@Column(name = "temporary_strg_end_date")
private LocalDateTime temporaryStorageEndDate;

// endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ca.bc.gov.backendstartapi.entity.seedlot.idclass;

import ca.bc.gov.backendstartapi.entity.SeedlotSeedPlanZoneEntity;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/** Composite key for {@link SeedlotSeedPlanZoneEntity}. */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@RequiredArgsConstructor
@Getter
@Setter
@EqualsAndHashCode
public class SeedlotSeedPlanZoneId {

@NonNull private String seedlot;

@NonNull private String seedPlanZoneCode;
}
Loading