Entrega Actividad 6.3: Patrón DAO + Introspección y reflexión
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
# Ignorar la carpeta de compilados
|
||||||
|
bin/
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Ignorar archivos de configuración de Eclipse
|
||||||
|
.settings/
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
module Componente_02 {
|
||||||
|
requires java.sql;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.palomafp.aadd.ljl;
|
||||||
|
|
||||||
|
public class AppPrincipal {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.palomafp.aadd.ljl.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.palomafp.aadd.ljl.model.Director;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IDirectorDAO {
|
||||||
|
|
||||||
|
public List<Director> obtenerListaContinentes();
|
||||||
|
|
||||||
|
public Director obtenerContinentePorCod(String idDirector);
|
||||||
|
|
||||||
|
public boolean insertarContinenteNuevo(Director director);
|
||||||
|
|
||||||
|
public boolean eliminarContinente(Director director);
|
||||||
|
|
||||||
|
public boolean actualizarContinente(Director director);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.palomafp.aadd.ljl.dao.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.palomafp.aadd.ljl.dao.IDirectorDAO;
|
||||||
|
import org.palomafp.aadd.ljl.model.Director;
|
||||||
|
|
||||||
|
public class DirectorDaoFichero implements IDirectorDAO {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Director> obtenerListaContinentes() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Director obtenerContinentePorCod(String idDirector) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean insertarContinenteNuevo(Director director) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean eliminarContinente(Director director) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean actualizarContinente(Director director) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
public class Actor {
|
||||||
|
|
||||||
|
private int identificador;
|
||||||
|
private String nombre;
|
||||||
|
private Date fechaNacimiento;
|
||||||
|
private Pais pais;
|
||||||
|
|
||||||
|
// Contructores
|
||||||
|
public Actor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
public Actor(int identificador, String nombre, Date fechaNacimiento, Pais pais) {
|
||||||
|
super();
|
||||||
|
this.identificador = identificador;
|
||||||
|
this.nombre = nombre;
|
||||||
|
this.fechaNacimiento = fechaNacimiento;
|
||||||
|
this.pais = pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Getters y Setters
|
||||||
|
public int getIdentificador() {
|
||||||
|
return identificador;
|
||||||
|
}
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
public Date getFechaNacimiento() {
|
||||||
|
return fechaNacimiento;
|
||||||
|
}
|
||||||
|
public Pais getPais() {
|
||||||
|
return pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentificador(int identificador) {
|
||||||
|
this.identificador = identificador;
|
||||||
|
}
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
public void setFechaNacimiento(Date fechaNacimiento) {
|
||||||
|
this.fechaNacimiento = fechaNacimiento;
|
||||||
|
}
|
||||||
|
public void setPais(Pais pais) {
|
||||||
|
this.pais = pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sobrescribimos el método toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Actor [identificador=" + identificador + ", nombre=" + nombre + ", fechaNacimiento=" + fechaNacimiento
|
||||||
|
+ ", pais=" + pais + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
public class Continente {
|
||||||
|
|
||||||
|
private String codigo;
|
||||||
|
private String nombre;
|
||||||
|
|
||||||
|
// Constructores
|
||||||
|
public Continente() {
|
||||||
|
|
||||||
|
}
|
||||||
|
public Continente(String codigo, String nombre) {
|
||||||
|
super();
|
||||||
|
this.codigo = codigo;
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Getters y setters
|
||||||
|
public String getCodigo() {
|
||||||
|
return codigo;
|
||||||
|
}
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigo(String codigo) {
|
||||||
|
this.codigo = codigo;
|
||||||
|
}
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sobrescribimos el método toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Continente [codigo=" + codigo + ", nombre=" + nombre + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class Director {
|
||||||
|
|
||||||
|
private int identificador;
|
||||||
|
private String nombre;
|
||||||
|
private Date fechaNacimiento;
|
||||||
|
private Pais pais;
|
||||||
|
|
||||||
|
// Constructores
|
||||||
|
public Director() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Director(int identificador, String nombre, Date fechaNacimiento, Pais pais) {
|
||||||
|
super();
|
||||||
|
this.identificador = identificador;
|
||||||
|
this.nombre = nombre;
|
||||||
|
this.fechaNacimiento = fechaNacimiento;
|
||||||
|
this.pais = pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters y setters
|
||||||
|
public int getIdentificador() {
|
||||||
|
return identificador;
|
||||||
|
}
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
public Date getFechaNacimiento() {
|
||||||
|
return fechaNacimiento;
|
||||||
|
}
|
||||||
|
public Pais getPais() {
|
||||||
|
return pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setIdentificador(int identificador) {
|
||||||
|
this.identificador = identificador;
|
||||||
|
}
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
public void setFechaNacimiento(Date fechaNacimiento) {
|
||||||
|
this.fechaNacimiento = fechaNacimiento;
|
||||||
|
}
|
||||||
|
public void setPais(Pais pais) {
|
||||||
|
this.pais = pais;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
public class Pais {
|
||||||
|
|
||||||
|
private int identificador;
|
||||||
|
private String nombre;
|
||||||
|
private String capital;
|
||||||
|
private Continente continente;
|
||||||
|
|
||||||
|
// Constructores
|
||||||
|
public Pais() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pais(int identificador, String nombre, String capital, Continente continente) {
|
||||||
|
super();
|
||||||
|
this.identificador = identificador;
|
||||||
|
this.nombre = nombre;
|
||||||
|
this.capital = capital;
|
||||||
|
this.continente = continente;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public int getIdentificador() {
|
||||||
|
return identificador;
|
||||||
|
}
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
public String getCapital() {
|
||||||
|
return capital;
|
||||||
|
}
|
||||||
|
public Continente getContinente() {
|
||||||
|
return continente;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setIdentificador(int identificador) {
|
||||||
|
this.identificador = identificador;
|
||||||
|
}
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
public void setCapital(String capital) {
|
||||||
|
this.capital = capital;
|
||||||
|
}
|
||||||
|
public void setContinente(Continente continente) {
|
||||||
|
this.continente = continente;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sobrescribimos el método ToString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Pais [identificador=" + identificador + ", nombre=" + nombre + ", capital=" + capital + ", continente="
|
||||||
|
+ continente + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
public class Pelicula {
|
||||||
|
|
||||||
|
private int identificador;
|
||||||
|
private String titulo;
|
||||||
|
private int anyo;
|
||||||
|
private String idioma;
|
||||||
|
private boolean color;
|
||||||
|
private String observaciones;
|
||||||
|
private Director director;
|
||||||
|
|
||||||
|
// Constructores
|
||||||
|
public Pelicula() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pelicula(int identificador, String titulo, int anyo, String idioma, boolean color, String observaciones,
|
||||||
|
Director director) {
|
||||||
|
super();
|
||||||
|
this.identificador = identificador;
|
||||||
|
this.titulo = titulo;
|
||||||
|
this.anyo = anyo;
|
||||||
|
this.idioma = idioma;
|
||||||
|
this.color = color;
|
||||||
|
this.observaciones = observaciones;
|
||||||
|
this.director = director;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters y setters
|
||||||
|
public int getIdentificador() {
|
||||||
|
return identificador;
|
||||||
|
}
|
||||||
|
public String getTitulo() {
|
||||||
|
return titulo;
|
||||||
|
}
|
||||||
|
public int getAnyo() {
|
||||||
|
return anyo;
|
||||||
|
}
|
||||||
|
public String getIdioma() {
|
||||||
|
return idioma;
|
||||||
|
}
|
||||||
|
public boolean isColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
public String getObservaciones() {
|
||||||
|
return observaciones;
|
||||||
|
}
|
||||||
|
public Director getDirector() {
|
||||||
|
return director;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setIdentificador(int identificador) {
|
||||||
|
this.identificador = identificador;
|
||||||
|
}
|
||||||
|
public void setTitulo(String titulo) {
|
||||||
|
this.titulo = titulo;
|
||||||
|
}
|
||||||
|
public void setAnyo(int anyo) {
|
||||||
|
this.anyo = anyo;
|
||||||
|
}
|
||||||
|
public void setIdioma(String idioma) {
|
||||||
|
this.idioma = idioma;
|
||||||
|
}
|
||||||
|
public void setColor(boolean color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
public void setObservaciones(String observaciones) {
|
||||||
|
this.observaciones = observaciones;
|
||||||
|
}
|
||||||
|
public void setDirector(Director director) {
|
||||||
|
this.director = director;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package org.palomafp.aadd.ljl.model;
|
||||||
|
|
||||||
|
public class Reparto {
|
||||||
|
|
||||||
|
private Pelicula pelicula;
|
||||||
|
private Actor actor;
|
||||||
|
private String personaje;
|
||||||
|
|
||||||
|
//Contructores
|
||||||
|
public Reparto() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Reparto(Pelicula pelicula, Actor actor, String personaje) {
|
||||||
|
super();
|
||||||
|
this.pelicula = pelicula;
|
||||||
|
this.actor = actor;
|
||||||
|
this.personaje = personaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters y setters
|
||||||
|
public Pelicula getPelicula() {
|
||||||
|
return pelicula;
|
||||||
|
}
|
||||||
|
public Actor getActor() {
|
||||||
|
return actor;
|
||||||
|
}
|
||||||
|
public String getPersonaje() {
|
||||||
|
return personaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPelicula(Pelicula pelicula) {
|
||||||
|
this.pelicula = pelicula;
|
||||||
|
}
|
||||||
|
public void setActor(Actor actor) {
|
||||||
|
this.actor = actor;
|
||||||
|
}
|
||||||
|
public void setPersonaje(String personaje) {
|
||||||
|
this.personaje = personaje;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sobreescribir el método toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Reparto [pelicula=" + pelicula + ", actor=" + actor + ", personaje=" + personaje + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user