Skip to content

Commit

Permalink
Insert in the db schema, a "Remedy" entity (list of plantingredient +…
Browse files Browse the repository at this point in the history
… partUsed)

Update all the concerned services and interfaces
Remains the adaptation of the CRUD admin interfaces
  • Loading branch information
acheype committed Jun 15, 2017
1 parent 7b75759 commit 573aa65
Show file tree
Hide file tree
Showing 167 changed files with 18,091 additions and 419 deletions.
15 changes: 15 additions & 0 deletions .jhipster/Remedy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "plantIngredients",
"otherEntityName": "plantIngredient",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "remedy"
}
],
"fields": [],
"changelogDate": "20170517041555",
"dto": "no",
"pagination": "pagination"
}
3 changes: 1 addition & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ module.exports = function (grunt) {
name: 'malariaplantdbApp',
deps: false,
wrap: '"use strict";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n{%= __ngModule %}'
},
dev: {
}, dev: {
options: {
dest: 'src/main/webapp/scripts/app/app.constants.js'
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-cssmin": "0.11.0",
"grunt-contrib-htmlmin": "0.4.0",
"grunt-contrib-imagemin": "0.9.3",
"grunt-contrib-imagemin": "^1.0.0",
"grunt-contrib-jshint": "0.11.0",
"grunt-contrib-uglify": "0.8.0",
"grunt-contrib-watch": "0.6.1",
Expand Down
44 changes: 19 additions & 25 deletions src/main/java/nc/ird/malariaplantdb/domain/Ethnology.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import nc.ird.malariaplantdb.domain.util.comparator.EthnologyComparator;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.*;
import java.util.Comparator;
import java.util.Objects;

/**
* Ethnology entity
Expand All @@ -22,7 +22,7 @@
* @author acheype
*/
@Entity
@JsonPropertyOrder({"id", "publication", "plantIngredients", "ethnoRelevancy", "treatmentType",
@JsonPropertyOrder({"id", "publication", "remedy", "ethnoRelevancy", "treatmentType",
"traditionalRecipeDetails", "preparationMode", "administrationRoute"})
@Table(name = "ethnology")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
Expand All @@ -40,14 +40,8 @@ public class Ethnology implements Serializable, Comparable<Ethnology> {
private Publication publication;

@NotNull
@ManyToMany(fetch = FetchType.EAGER)
@BatchSize(size = 10)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "ETHNOLOGY_PLANT_INGREDIENT",
joinColumns = @JoinColumn(name = "ethnologies_id", referencedColumnName = "ID"),
inverseJoinColumns = @JoinColumn(name = "plant_ingredients_id", referencedColumnName = "ID"))
@SortNatural
private SortedSet<PlantIngredient> plantIngredients = new TreeSet<>();
@ManyToOne
private Remedy remedy;

@NotNull
@Lob
Expand All @@ -73,28 +67,28 @@ public class Ethnology implements Serializable, Comparable<Ethnology> {
@Column(name = "administration_route", length = 255)
private String administrationRoute;

public Publication getPublication() {
return publication;
public Long getId() {
return id;
}

public void setPublication(Publication publication) {
this.publication = publication;
public void setId(Long id) {
this.id = id;
}

public Set<PlantIngredient> getPlantIngredients() {
return plantIngredients;
public Publication getPublication() {
return publication;
}

public void setPlantIngredients(SortedSet<PlantIngredient> PlantIngredients) {
this.plantIngredients = PlantIngredients;
public void setPublication(Publication publication) {
this.publication = publication;
}

public Long getId() {
return id;
public Remedy getRemedy() {
return remedy;
}

public void setId(Long id) {
this.id = id;
public void setRemedy(Remedy remedy) {
this.remedy = remedy;
}

public String getEthnoRelevancy() {
Expand Down
52 changes: 22 additions & 30 deletions src/main/java/nc/ird/malariaplantdb/domain/InVitroPharmaco.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import nc.ird.malariaplantdb.domain.util.comparator.InVitroPharmacoComparator;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;

/**
* In vitro pharmacology entity
Expand All @@ -25,7 +22,7 @@
* @author acheype
*/
@Entity
@JsonPropertyOrder({"id", "publication", "plantIngredients", "testedEntity", "extractionSolvent", "additiveProduct",
@JsonPropertyOrder({"id", "publication", "remedy", "testedEntity", "extractionSolvent", "additiveProduct",
"compoundName", "screeningTest", "measureMethod", "concentration", "molConcentration", "inhibition", "ic50",
"molIc50", "selectivityIndex", "compilersObservations"})
@Table(name = "in_vitro_pharmaco")
Expand All @@ -43,14 +40,9 @@ public class InVitroPharmaco implements Serializable, Comparable<InVitroPharmaco
@ManyToOne
private Publication publication;

@ManyToMany(fetch = FetchType.EAGER)
@BatchSize(size = 100)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "in_vitro_pharmaco_plant_ingredient",
joinColumns = @JoinColumn(name = "in_vitro_pharmacos_id", referencedColumnName = "ID"),
inverseJoinColumns = @JoinColumn(name = "plant_ingredients_id", referencedColumnName = "ID"))
@SortNatural
private SortedSet<PlantIngredient> plantIngredients = new TreeSet<>();
@NotNull
@ManyToOne
private Remedy remedy;

@NotNull
@Size(max = 255)
Expand Down Expand Up @@ -127,6 +119,22 @@ public void setId(Long id) {
this.id = id;
}

public Publication getPublication() {
return publication;
}

public void setPublication(Publication publication) {
this.publication = publication;
}

public Remedy getRemedy() {
return remedy;
}

public void setRemedy(Remedy remedy) {
this.remedy = remedy;
}

public String getTestedEntity() {
return testedEntity;
}
Expand Down Expand Up @@ -231,22 +239,6 @@ public void setCompilersObservations(String compilersObservations) {
this.compilersObservations = compilersObservations;
}

public Publication getPublication() {
return publication;
}

public void setPublication(Publication publication) {
this.publication = publication;
}

public SortedSet<PlantIngredient> getPlantIngredients() {
return plantIngredients;
}

public void setPlantIngredients(SortedSet<PlantIngredient> PlantIngredients) {
this.plantIngredients = PlantIngredients;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
52 changes: 22 additions & 30 deletions src/main/java/nc/ird/malariaplantdb/domain/InVivoPharmaco.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import nc.ird.malariaplantdb.domain.util.comparator.InVivoPharmacoComparator;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;

/**
* In vivo pharmacology entity
Expand All @@ -25,7 +22,7 @@
* @author acheype
*/
@Entity
@JsonPropertyOrder({"id", "publication", "plantIngredients", "testedEntity", "extractionSolvent", "additiveProduct",
@JsonPropertyOrder({"id", "publication", "remedy", "testedEntity", "extractionSolvent", "additiveProduct",
"compoundName", "screeningTest", "treatmentRoute", "dose", "inhibition", "survivalPercent", "survivalTime", "ed50",
"ld50", "compilersObservations"})
@Table(name = "in_vivo_pharmaco")
Expand All @@ -43,14 +40,9 @@ public class InVivoPharmaco implements Serializable, Comparable<InVivoPharmaco>
@ManyToOne
private Publication publication;

@ManyToMany(fetch = FetchType.EAGER)
@BatchSize(size = 100)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "in_vivo_pharmaco_plant_ingredient",
joinColumns = @JoinColumn(name = "in_vivo_pharmacos_id", referencedColumnName = "ID"),
inverseJoinColumns = @JoinColumn(name = "plant_ingredients_id", referencedColumnName = "ID"))
@SortNatural
private SortedSet<PlantIngredient> plantIngredients = new TreeSet<>();
@NotNull
@ManyToOne
private Remedy remedy;

@NotNull
@Size(max = 255)
Expand Down Expand Up @@ -127,6 +119,22 @@ public void setId(Long id) {
this.id = id;
}

public Publication getPublication() {
return publication;
}

public void setPublication(Publication publication) {
this.publication = publication;
}

public Remedy getRemedy() {
return remedy;
}

public void setRemedy(Remedy remedy) {
this.remedy = remedy;
}

public String getTestedEntity() {
return testedEntity;
}
Expand Down Expand Up @@ -231,22 +239,6 @@ public void setCompilersObservations(String compilersObservations) {
this.compilersObservations = compilersObservations;
}

public Publication getPublication() {
return publication;
}

public void setPublication(Publication publication) {
this.publication = publication;
}

public SortedSet<PlantIngredient> getPlantIngredients() {
return plantIngredients;
}

public void setPlantIngredients(SortedSet<PlantIngredient> PlantIngredients) {
this.plantIngredients = PlantIngredients;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
17 changes: 15 additions & 2 deletions src/main/java/nc/ird/malariaplantdb/domain/PlantIngredient.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
*/
@Entity
@JsonPropertyOrder({"id", "species", "partUsed"})
@Table(name = "plant_ingredient", uniqueConstraints = @UniqueConstraint(columnNames = {"species_id", "part_used"},
name = "uk_plantingredient_speciesid_partused"))
@Table(name = "plant_ingredient", uniqueConstraints = @UniqueConstraint(columnNames = {"species_id", "part_used",
"remedy_id"},
name = "uk_plantingredient_speciesid_partused_remedy_id"))
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "plantingredient")
public class PlantIngredient implements Serializable, Comparable<PlantIngredient> {
Expand All @@ -43,6 +44,10 @@ public class PlantIngredient implements Serializable, Comparable<PlantIngredient
@Column(name = "part_used", length = 255, nullable = false)
private String partUsed;

@NotNull
@ManyToOne
private Remedy remedy;

public Long getId() {
return id;
}
Expand All @@ -67,6 +72,14 @@ public void setPartUsed(String partUsed) {
this.partUsed = partUsed;
}

public Remedy getRemedy() {
return remedy;
}

public void setRemedy(Remedy remedy) {
this.remedy = remedy;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Loading

0 comments on commit 573aa65

Please sign in to comment.