Springboot
parent
c646d15a25
commit
5cb6e5c108
@ -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 java.util.Date;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name="questionpartiekahoot")
|
||||||
|
public class QuestionPartieKahoot {
|
||||||
|
@EmbeddedId
|
||||||
|
private QuestionPartieKahootKey id = new QuestionPartieKahootKey();
|
||||||
|
|
||||||
|
@JsonBackReference
|
||||||
|
@ManyToOne
|
||||||
|
@MapsId("idQuestion")
|
||||||
|
@JoinColumn(name = "idquestion")
|
||||||
|
private Question question;
|
||||||
|
|
||||||
|
@JsonBackReference
|
||||||
|
@ManyToOne
|
||||||
|
@MapsId("idPartieKahoot")
|
||||||
|
@JoinColumn(name="idpartiekahoot")
|
||||||
|
private PartieKahoot partie;
|
||||||
|
}
|
@ -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 QuestionPartieKahootKey implements Serializable {
|
||||||
|
@Column(name="idquestion")
|
||||||
|
private Integer idQuestion;
|
||||||
|
|
||||||
|
@Column(name="idpartiekahoot")
|
||||||
|
private Integer idPartieKahoot;
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package fr.iut.sciencequest.sae.repositories;
|
||||||
|
|
||||||
|
import fr.iut.sciencequest.sae.entities.QuestionPartieKahoot;
|
||||||
|
import fr.iut.sciencequest.sae.entities.QuestionPartieKahootKey;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface QuestionPartieKahootRepository extends CrudRepository<QuestionPartieKahoot, QuestionPartieKahootKey> {}
|
Loading…
Reference in new issue