-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonas Delannoy
committed
Nov 24, 2019
1 parent
c58fffa
commit 13bd974
Showing
13 changed files
with
136 additions
and
50 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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/fr/kungfunantes/backend/model/exercise/ExerciseCriteria.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,40 @@ | ||
package fr.kungfunantes.backend.model.exercise; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Table; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Inheritance; | ||
import javax.persistence.InheritanceType; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
|
||
import fr.kungfunantes.backend.model.exercise.taolu.Taolu; | ||
import fr.kungfunantes.backend.model.criteria.Criteria; | ||
|
||
@Entity | ||
@ApiModel | ||
public class ExerciseCriteria { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "exerciseId") | ||
Taolu taolu; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "criteriaId") | ||
Criteria criteria; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/fr/kungfunantes/backend/model/exercise/ExerciseRound.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,40 @@ | ||
package fr.kungfunantes.backend.model.exercise; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Table; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Inheritance; | ||
import javax.persistence.InheritanceType; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
|
||
import fr.kungfunantes.backend.model.exercise.fight.Fight; | ||
import fr.kungfunantes.backend.model.round.Round; | ||
|
||
@Entity | ||
@ApiModel | ||
public class ExerciseRound { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "exerciseId") | ||
Fight fight; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "roundId") | ||
Round round; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
} |
20 changes: 6 additions & 14 deletions
20
src/main/java/fr/kungfunantes/backend/model/exercise/fight/Fight.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 |
---|---|---|
@@ -1,28 +1,20 @@ | ||
package fr.kungfunantes.backend.model.exercise.fight; | ||
|
||
import fr.kungfunantes.backend.model.exercise.ExerciseRound; | ||
import fr.kungfunantes.backend.model.exercise.Exercise; | ||
import fr.kungfunantes.backend.model.round.Round; | ||
import io.swagger.annotations.ApiModel; | ||
|
||
import javax.persistence.*; | ||
import java.util.Set; | ||
import java.util.List; | ||
|
||
@Entity | ||
@ApiModel | ||
@DiscriminatorValue(value = "FIGHT") | ||
public class Fight extends Exercise { | ||
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) | ||
@JoinTable(name = "exercise_round", | ||
joinColumns = @JoinColumn(name = "exerciseId"), | ||
inverseJoinColumns = @JoinColumn(name = "roundId") | ||
) | ||
private Set<Round> rounds; | ||
@OneToMany | ||
List<ExerciseRound> exerciseRound; | ||
|
||
public Set<Round> getRounds() { | ||
return rounds; | ||
} | ||
|
||
public void setRounds(Set<Round> rounds) { | ||
this.rounds = rounds; | ||
public String getType() { | ||
return "FIGHT"; | ||
} | ||
} |
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
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
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
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
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
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
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
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