Skip to content

Commit

Permalink
fix: seedlot columns and area of use (#685)
Browse files Browse the repository at this point in the history
* fix: seedlot columns and area of use

no issue related

* feat: add area of use entity class

no issue related

* chore: rename wrong seedlot variable name

* chore: replace tabs by space on migration v22

* chore: add missing javadoc for the SeedlotSeedPlanZoneEntity class
  • Loading branch information
Ricardo Campos authored Dec 1, 2023
1 parent 949a1b4 commit abfc418
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 12 deletions.
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

0 comments on commit abfc418

Please sign in to comment.