feat: rework competition perm, naming, competition data
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m6s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m6s
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
package fr.titionfire.ffsaf.data.id;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.CompetitionModel;
|
||||
import fr.titionfire.ffsaf.data.model.MembreModel;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import lombok.Data;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Embeddable
|
||||
public class RegisterId implements Serializable {
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "id_competition")
|
||||
private CompetitionModel competition;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "id_membre")
|
||||
private MembreModel membre;
|
||||
private Long competitionId;
|
||||
private Long membreId;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.List;
|
||||
@RegisterForReflection
|
||||
|
||||
@Entity
|
||||
@Table(name = "poule")
|
||||
public class PouleModel {
|
||||
@Table(name = "category")
|
||||
public class CategoryModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Long id;
|
||||
@@ -34,11 +34,11 @@ public class PouleModel {
|
||||
CompetitionModel compet;
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "id_poule", referencedColumnName = "id")
|
||||
@JoinColumn(name = "id_category", referencedColumnName = "id")
|
||||
List<MatchModel> matchs;
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "id_poule", referencedColumnName = "id")
|
||||
@JoinColumn(name = "id_category", referencedColumnName = "id")
|
||||
List<TreeModel> tree;
|
||||
|
||||
Integer type;
|
||||
@@ -1,6 +1,7 @@
|
||||
package fr.titionfire.ffsaf.data.model;
|
||||
|
||||
import fr.titionfire.ffsaf.utils.CompetitionSystem;
|
||||
import fr.titionfire.ffsaf.utils.RegisterMode;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -21,6 +22,7 @@ import java.util.List;
|
||||
@Table(name = "compet")
|
||||
public class CompetitionModel {
|
||||
@Id
|
||||
@Access(AccessType.PROPERTY)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Long id;
|
||||
|
||||
@@ -36,9 +38,26 @@ public class CompetitionModel {
|
||||
String uuid;
|
||||
|
||||
Date date;
|
||||
Date todate;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
String description;
|
||||
String adresse;
|
||||
|
||||
Date startRegister;
|
||||
Date endRegister;
|
||||
|
||||
RegisterMode registerMode;
|
||||
|
||||
boolean publicVisible;
|
||||
|
||||
@OneToMany(mappedBy = "competition", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
||||
List<RegisterModel> insc;
|
||||
|
||||
String owner;
|
||||
|
||||
String data1;
|
||||
String data2;
|
||||
String data3;
|
||||
String data4;
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ public class MatchModel {
|
||||
String c2_str = null;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "id_poule", referencedColumnName = "id")
|
||||
PouleModel poule = null;
|
||||
@JoinColumn(name = "id_category", referencedColumnName = "id")
|
||||
CategoryModel category = null;
|
||||
|
||||
long poule_ord = 0;
|
||||
long category_ord = 0;
|
||||
|
||||
boolean isEnd = true;
|
||||
|
||||
@@ -52,5 +52,5 @@ public class MatchModel {
|
||||
@CollectionTable(name = "score", joinColumns = @JoinColumn(name = "id_match"))
|
||||
List<ScoreEmbeddable> scores = new ArrayList<>();
|
||||
|
||||
char groupe = 'A';
|
||||
char poule = 'A';
|
||||
}
|
||||
|
||||
@@ -17,14 +17,17 @@ import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "register")
|
||||
@IdClass(RegisterId.class)
|
||||
public class RegisterModel {
|
||||
@Id
|
||||
|
||||
@EmbeddedId
|
||||
RegisterId id;
|
||||
|
||||
@MapsId("competitionId")
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "id_competition")
|
||||
CompetitionModel competition;
|
||||
|
||||
@Id
|
||||
@MapsId("membreId")
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "id_membre")
|
||||
MembreModel membre;
|
||||
@@ -37,4 +40,14 @@ public class RegisterModel {
|
||||
@JoinColumn(name = "club")
|
||||
ClubModel club = null;
|
||||
|
||||
public RegisterModel(CompetitionModel competition, MembreModel membre, Integer weight, int overCategory,
|
||||
Categorie categorie, ClubModel club) {
|
||||
this.id = new RegisterId(competition.getId(), membre.getId());
|
||||
this.competition = competition;
|
||||
this.membre = membre;
|
||||
this.weight = weight;
|
||||
this.overCategory = overCategory;
|
||||
this.categorie = categorie;
|
||||
this.club = club;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ public class TreeModel {
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Long id;
|
||||
|
||||
@Column(name = "id_poule")
|
||||
Long poule;
|
||||
@Column(name = "id_category")
|
||||
Long category;
|
||||
|
||||
Integer level;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fr.titionfire.ffsaf.data.repository;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.PouleModel;
|
||||
import fr.titionfire.ffsaf.data.model.CategoryModel;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@ApplicationScoped
|
||||
public class PouleRepository implements PanacheRepositoryBase<PouleModel, Long> {
|
||||
public class CategoryRepository implements PanacheRepositoryBase<CategoryModel, Long> {
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package fr.titionfire.ffsaf.data.repository;
|
||||
|
||||
import fr.titionfire.ffsaf.data.id.RegisterId;
|
||||
import fr.titionfire.ffsaf.data.model.RegisterModel;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepository;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@ApplicationScoped
|
||||
public class RegisterRepository implements PanacheRepository<RegisterModel> {
|
||||
public class RegisterRepository implements PanacheRepositoryBase<RegisterModel, RegisterId> {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user