46 lines
1.4 KiB
Java
46 lines
1.4 KiB
Java
package org.palomafp.aadd.rif;
|
|
|
|
import java.util.List;
|
|
import org.palomafp.aadd.rif.dao.IPaisDAO;
|
|
import org.palomafp.aadd.rif.dao.impl.PaisDAO;
|
|
import org.palomafp.aadd.rif.model.Pais;
|
|
|
|
public class GestorMapaMundi {
|
|
|
|
private final IPaisDAO paisDAO;
|
|
|
|
public GestorMapaMundi() {
|
|
this.paisDAO = new PaisDAO();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
GestorMapaMundi gestor = new GestorMapaMundi();
|
|
|
|
// Prueba A: ID 105
|
|
System.out.println("--- Buscando País con ID 105 ---");
|
|
Pais pais = gestor.obtenerPaisesPorIdentificador(105);
|
|
if (pais != null) {
|
|
System.out.println(pais);
|
|
} else {
|
|
System.out.println("País no encontrado.");
|
|
}
|
|
|
|
// Prueba B: Continente "04"
|
|
System.out.println("\n--- Buscando Países del Continente '04' ---");
|
|
List<Pais> lista = gestor.obtenerListaPaisesPorContinente("04");
|
|
if (!lista.isEmpty()) {
|
|
lista.forEach(System.out::println);
|
|
} else {
|
|
System.out.println("No se encontraron países.");
|
|
}
|
|
}
|
|
|
|
public Pais obtenerPaisesPorIdentificador(int identificador) {
|
|
return paisDAO.obtenerPaisPorID(identificador);
|
|
}
|
|
|
|
public List<Pais> obtenerListaPaisesPorContinente(String codContinente) {
|
|
return paisDAO.obtenerPaisesPorContinente(codContinente);
|
|
}
|
|
}
|