Skip to content

Commit c036d8a

Browse files
authored
Merge pull request #42 from Breeding-Insight/bug/BI-2423
BI-2423 - Add @where annotation to entites to filter out soft deleted rows
2 parents 25a54cf + db5f678 commit c036d8a

File tree

7 files changed

+14
-0
lines changed

7 files changed

+14
-0
lines changed

src/main/java/org/brapi/test/BrAPITestServer/model/entity/core/DatasetAuthorshipEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
import javax.persistence.*;
66

77
import org.brapi.test.BrAPITestServer.model.entity.BrAPIBaseEntity;
8+
import org.hibernate.annotations.Where;
89

910
@Entity
1011
@Table(name = "trial_dataset_authorship")
12+
@Where(clause = "soft_deleted = false")
1113
public class DatasetAuthorshipEntity extends BrAPIBaseEntity {
1214
@Column
1315
private String datasetPUI;

src/main/java/org/brapi/test/BrAPITestServer/model/entity/core/PublicationEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
import javax.persistence.*;
44

55
import org.brapi.test.BrAPITestServer.model.entity.BrAPIBaseEntity;
6+
import org.hibernate.annotations.Where;
67

78
@Entity
89
@Table(name = "trial_publication")
10+
@Where(clause = "soft_deleted = false")
911
public class PublicationEntity extends BrAPIBaseEntity {
1012
@Column
1113
private String publicationPUI;

src/main/java/org/brapi/test/BrAPITestServer/model/entity/core/StudyEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
import org.brapi.test.BrAPITestServer.model.entity.pheno.ObservationEntity;
1010
import org.brapi.test.BrAPITestServer.model.entity.pheno.ObservationUnitEntity;
1111
import org.brapi.test.BrAPITestServer.model.entity.pheno.ObservationVariableEntity;
12+
import org.hibernate.annotations.Where;
1213

1314
@Entity
1415
@Table(name = "study")
16+
@Where(clause = "soft_deleted = false")
1517
public class StudyEntity extends BrAPIPrimaryEntity {
1618

1719
@Column

src/main/java/org/brapi/test/BrAPITestServer/model/entity/geno/CallSetEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
import javax.persistence.*;
88

99
import org.brapi.test.BrAPITestServer.model.entity.BrAPIPrimaryEntity;
10+
import org.hibernate.annotations.Where;
1011

1112
@Entity
1213
@Table(name = "callset")
14+
@Where(clause = "soft_deleted = false")
1315
public class CallSetEntity extends BrAPIPrimaryEntity {
1416
@Column
1517
private String callSetName;

src/main/java/org/brapi/test/BrAPITestServer/model/entity/geno/PlateEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414

1515
import io.swagger.model.geno.PlateFormat;
1616
import io.swagger.model.geno.SampleType;
17+
import org.hibernate.annotations.Where;
1718

1819
@Entity
1920
@Table(name="plate")
21+
@Where(clause = "soft_deleted = false")
2022
public class PlateEntity extends BrAPIPrimaryEntity{
2123
@Column
2224
private String clientPlateDbId;

src/main/java/org/brapi/test/BrAPITestServer/model/entity/pheno/ObservationEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
import org.brapi.test.BrAPITestServer.model.entity.core.SeasonEntity;
1212
import org.brapi.test.BrAPITestServer.model.entity.core.StudyEntity;
1313
import org.brapi.test.BrAPITestServer.model.entity.core.TrialEntity;
14+
import org.hibernate.annotations.Where;
1415

1516
@Entity
1617
@Table(name = "observation")
18+
@Where(clause = "soft_deleted = false")
1719
public class ObservationEntity extends BrAPIPrimaryEntity {
1820
@Column
1921
private String collector;

src/main/java/org/brapi/test/BrAPITestServer/model/entity/pheno/ObservationUnitEntity.java

+2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
import org.brapi.test.BrAPITestServer.model.entity.germ.CrossEntity;
1313
import org.brapi.test.BrAPITestServer.model.entity.germ.GermplasmEntity;
1414
import org.brapi.test.BrAPITestServer.model.entity.germ.SeedLotEntity;
15+
import org.hibernate.annotations.Where;
1516

1617
@Entity
1718
@Table(name = "observation_unit")
19+
@Where(clause = "soft_deleted = false")
1820
public class ObservationUnitEntity extends BrAPIPrimaryEntity {
1921
@ManyToOne(fetch = FetchType.LAZY)
2022
private CrossEntity cross;

0 commit comments

Comments
 (0)