forked from tom.biard/ScienceQuest
parent
504204e892
commit
161ae36542
@ -0,0 +1,18 @@
|
|||||||
|
package fr.iut.sciencequest.sae.dto.scorePartieJoueur;
|
||||||
|
|
||||||
|
import fr.iut.sciencequest.sae.dto.joueur.JoueurSimpleDTO;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.*;
|
||||||
|
import org.springframework.hateoas.RepresentationModel;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class ScorePartieKahootJoueurDTO extends RepresentationModel<ScorePartieKahootJoueurDTO> {
|
||||||
|
@NotNull
|
||||||
|
private JoueurSimpleDTO joueur;
|
||||||
|
|
||||||
|
private Integer score;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package fr.iut.sciencequest.sae.entities;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Fetch;
|
||||||
|
import org.hibernate.annotations.FetchMode;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name="scorepartiekahootjoueur")
|
||||||
|
public class ScorePartieKahootJoueur {
|
||||||
|
@EmbeddedId
|
||||||
|
private ScorePartieKahootJoueurKey id = new ScorePartieKahootJoueurKey();
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@MapsId("idJoueur")
|
||||||
|
@JoinColumn(name = "idjoueur")
|
||||||
|
private Joueur joueur;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@MapsId("idPartie")
|
||||||
|
@JoinColumn(name="idpartie")
|
||||||
|
private Partie partie;
|
||||||
|
|
||||||
|
private Integer score = 0;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package fr.iut.sciencequest.sae.entities;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Embeddable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Embeddable
|
||||||
|
public class ScorePartieKahootJoueurKey implements Serializable {
|
||||||
|
@Column(name="idjoueur")
|
||||||
|
private Integer idJoueur;
|
||||||
|
|
||||||
|
@Column(name="idpartie")
|
||||||
|
private Integer idPartie;
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package fr.iut.sciencequest.sae.repositories;
|
||||||
|
|
||||||
|
import fr.iut.sciencequest.sae.entities.ScorePartieKahootJoueur;
|
||||||
|
import fr.iut.sciencequest.sae.entities.ScorePartieKahootJoueurKey;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface ScorePartieKahootJoueurRepository extends CrudRepository<ScorePartieKahootJoueur, ScorePartieKahootJoueurKey> {}
|
Loading…
Reference in new issue