Guest User

Untitled

a guest
Jan 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. @Embeddable
  2. public class DificultadAlumnoEjercicioPK implements Serializable {
  3.  
  4. private static final long serialVersionUID = 5559503979252689702L;
  5.  
  6. public Alumno alumno;
  7.  
  8. public Ejercicio ejercicio;
  9.  
  10. // Constructors / Getters / Setters
  11.  
  12. }
  13.  
  14. CREATE TABLE `dificultadAlumnoEjercicio` (
  15.  
  16. `alumnoDNINumeros` CHAR(8),
  17. `alumnoDNILetra` CHAR,
  18. `ejercicioID` INT,
  19. `dificultadID` INT NOT NULL,
  20.  
  21. PRIMARY KEY (alumnoDNINumeros, alumnoDNILetra, ejercicioID),
  22. FOREIGN KEY (alumnoDNINumeros, alumnoDNILetra) REFERENCES alumno(dniNumeros, dniLetra),
  23. FOREIGN KEY (dificultadID) REFERENCES dificultad(id),
  24. FOREIGN KEY (ejercicioID) REFERENCES ejercicio(id)
  25.  
  26. CREATE TABLE `alumno` (
  27.  
  28. `dniNumeros` CHAR(8),
  29. `dniLetra` CHAR,
  30.  
  31. PRIMARY KEY (dniNumeros, dniLetra),
  32. FOREIGN KEY (dniNumeros, dniLetra) REFERENCES persona(dniNumeros, dniLetra)
Add Comment
Please, Sign In to add comment