feat: add data model for licence
This commit is contained in:
parent
58c2134e35
commit
c6130cf65f
@ -0,0 +1,26 @@
|
||||
package fr.titionfire.ffsaf.data.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@RegisterForReflection
|
||||
|
||||
@Entity
|
||||
@Table(name = "affiliation")
|
||||
public class AffiliationModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "club", referencedColumnName = "id")
|
||||
ClubModel club;
|
||||
|
||||
int saison;
|
||||
}
|
||||
@ -5,6 +5,7 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@ -49,4 +50,7 @@ public class ClubModel {
|
||||
String no_affiliation;
|
||||
|
||||
boolean international;
|
||||
|
||||
@OneToMany(mappedBy = "club", fetch = FetchType.EAGER)
|
||||
List<AffiliationModel> affiliations;
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package fr.titionfire.ffsaf.data.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@RegisterForReflection
|
||||
|
||||
@Entity
|
||||
@Table(name = "licence")
|
||||
public class LicenceModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "membre", referencedColumnName = "id")
|
||||
MembreModel membre;
|
||||
|
||||
int saison;
|
||||
|
||||
boolean certificate;
|
||||
|
||||
boolean validate;
|
||||
}
|
||||
@ -9,6 +9,7 @@ import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ -51,4 +52,7 @@ public class MembreModel {
|
||||
GradeArbitrage grade_arbitrage;
|
||||
|
||||
String url_photo;
|
||||
|
||||
@OneToMany(mappedBy = "membre", fetch = FetchType.EAGER)
|
||||
List<LicenceModel> licences;
|
||||
}
|
||||
|
||||
@ -49,10 +49,4 @@ public class ClubEntity {
|
||||
.international(model.isInternational())
|
||||
.build();
|
||||
}
|
||||
|
||||
public ClubModel toModel () {
|
||||
return new ClubModel(this.id, this.clubId, this.name, this.country, this.shieldURL, this.contact, this.training_location,
|
||||
this.training_day_time, this.contact_intern, this.RNA, this.SIRET, this.no_affiliation,
|
||||
this.international);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user