generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: seedlot columns and area of use (#685)
* 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
Showing
7 changed files
with
414 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
backend/src/main/java/ca/bc/gov/backendstartapi/entity/SeedlotSeedPlanZoneEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...src/main/java/ca/bc/gov/backendstartapi/entity/seedlot/idclass/SeedlotSeedPlanZoneId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.