Guest User

Untitled

a guest
May 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. @Entity
  2. @Data
  3. @AllArgsConstructor
  4. @NoArgsConstructor
  5. public class Contrat implements Serializable{
  6.  
  7. @Id @GeneratedValue
  8. private Long id;
  9. private Date dateDebut ;
  10. private Date dateFin ;
  11. @ManyToOne
  12. @JoinColumn(name = "Id_Project")
  13. @JsonBackReference(value="projet-contrat")
  14. private Project project;
  15.  
  16. @ManyToOne
  17. @JoinColumn(name = "Id_AppUser")
  18. @JsonBackReference(value="appuser-contrat")
  19. private AppUser appUser;
  20. }
  21.  
  22. public interface ContratRepo extends JpaRepository<Contrat,Long> {
  23.  
  24. @Query("select from Contrat c where c.appUser = :userApp")
  25. public Page<Contrat> chercherContrat(@Param("userApp") AppUser userApp
  26. , Pageable pageable);
  27.  
  28. }
  29.  
  30. {id: 1, dateDebut: 1526083200000, dateFin: 1526083200000}
Add Comment
Please, Sign In to add comment