Instituto Formacion
This commit is contained in:
parent
3b06e360c5
commit
9e9b41e917
@ -26,7 +26,7 @@
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-25">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
||||
2
.settings/org.eclipse.core.resources.prefs
Normal file
2
.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@ -51,7 +51,7 @@ public class ProcesadorFormacionInstitutoCSV {
|
||||
// Si el registro es de tipo "S" se tratará para insertarse en la Base de datos.
|
||||
if (registroATratar.equals("S")) {
|
||||
InstitutoFormacion institutoFormacion = new InstitutoFormacion();
|
||||
InstitutoFormacionID institutoFormacionID = new InstitutoFormacionID(idInstituto, codFormacion);
|
||||
InstitutoFormacionID institutoFormacionID = new InstitutoFormacionID(idInstituto, codFormacion,anyo);
|
||||
|
||||
Instituto instituto = new Instituto();
|
||||
instituto.setIdentificador(idInstituto);
|
||||
@ -61,7 +61,6 @@ public class ProcesadorFormacionInstitutoCSV {
|
||||
institutoFormacion.setIdInstitutoFormacion(institutoFormacionID);
|
||||
institutoFormacion.setInstituto(instituto);
|
||||
institutoFormacion.setFormacion(formacion);
|
||||
institutoFormacion.setAnyoAcademico(anyo);
|
||||
|
||||
listaInstitutoFormacion.add(institutoFormacion);
|
||||
}
|
||||
|
||||
@ -32,46 +32,31 @@ public class InstitutoFormacion {
|
||||
@JoinColumn(name="cod_formacion", insertable=false, updatable=false)
|
||||
private Formacion formacion;
|
||||
|
||||
@Column(name="anyo_academico")
|
||||
private int anyoAcademico;
|
||||
|
||||
@Embeddable
|
||||
public static class InstitutoFormacionID{
|
||||
public InstitutoFormacionID() {
|
||||
|
||||
}
|
||||
public InstitutoFormacionID(Integer idInstituto, String codFormacion) {
|
||||
this.codFormacion=codFormacion;
|
||||
this.idIntituto=idInstituto;
|
||||
|
||||
|
||||
public InstitutoFormacionID(Integer idIntituto, String codFormacion, int anyoAcademico) {
|
||||
super();
|
||||
this.idIntituto = idIntituto;
|
||||
this.codFormacion = codFormacion;
|
||||
this.anyoAcademico = anyoAcademico;
|
||||
}
|
||||
|
||||
|
||||
@Column(name="id_instituto")
|
||||
private Integer idIntituto;
|
||||
|
||||
@Column(name="cod_formacion")
|
||||
private String codFormacion;
|
||||
|
||||
@Column(name="anyo_academico")
|
||||
private int anyoAcademico;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(codFormacion, idIntituto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
InstitutoFormacionID other = (InstitutoFormacionID) obj;
|
||||
return Objects.equals(codFormacion, other.codFormacion) && Objects.equals(idIntituto, other.idIntituto);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InstitutoFormacionID [idIntituto=" + idIntituto + ", idFormacion=" + codFormacion + "]";
|
||||
}
|
||||
public Integer getIdIntituto() {
|
||||
return idIntituto;
|
||||
}
|
||||
@ -84,13 +69,37 @@ public class InstitutoFormacion {
|
||||
public void setCodFormacion(String codFormacion) {
|
||||
this.codFormacion = codFormacion;
|
||||
}
|
||||
public int getAnyoAcademico() {
|
||||
return anyoAcademico;
|
||||
}
|
||||
public void setAnyoAcademico(int anyoAcademico) {
|
||||
this.anyoAcademico = anyoAcademico;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(anyoAcademico, codFormacion, idIntituto);
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
InstitutoFormacionID other = (InstitutoFormacionID) obj;
|
||||
return anyoAcademico == other.anyoAcademico && Objects.equals(codFormacion, other.codFormacion)
|
||||
&& Objects.equals(idIntituto, other.idIntituto);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InstitutoFormacionID [idIntituto=" + idIntituto + ", codFormacion=" + codFormacion
|
||||
+ ", anyoAcademico=" + anyoAcademico + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InstitutoFormacion [idInstitutoFormacion=" + idInstitutoFormacion + ", instituto=" + instituto
|
||||
+ ", formacion=" + formacion + ", anyoAcademico=" + anyoAcademico + "]";
|
||||
}
|
||||
|
||||
public InstitutoFormacionID getIdInstitutoFormacion() {
|
||||
return idInstitutoFormacion;
|
||||
@ -116,11 +125,10 @@ public class InstitutoFormacion {
|
||||
this.formacion = formacion;
|
||||
}
|
||||
|
||||
public int getAnyoAcademico() {
|
||||
return anyoAcademico;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InstitutoFormacion [idInstitutoFormacion=" + idInstitutoFormacion + ", instituto=" + instituto
|
||||
+ ", formacion=" + formacion + "]";
|
||||
}
|
||||
|
||||
public void setAnyoAcademico(int anyoAcademico) {
|
||||
this.anyoAcademico = anyoAcademico;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,10 +12,8 @@
|
||||
<!-- Configuración para la conexión a la Base de Datos -->
|
||||
<properties>
|
||||
<property name="jakarta.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver" />
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://192.168.1.36:3306/formacionfp_dam2" />
|
||||
<property name="jakarta.persistence.jdbc.user" value="root" />
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://10.11.218.147:3306/formacionfp_dam2" /> <property name="jakarta.persistence.jdbc.user" value="root" />
|
||||
<property name="jakarta.persistence.jdbc.password" value="mysql_123" />
|
||||
|
||||
<property name="hibernate.show_sql" value="true" />
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# Información sobre la Base de datos PostgreSQL
|
||||
jdbc.driver=org.postgresql.Driver
|
||||
jdbc.url=jdbc:postgresql://192.168.1.36:5432/formacionfp_origen
|
||||
jdbc.url=jdbc:postgresql://10.11.218.147:5432/formacionfp_postgresql
|
||||
jdbc.usuario=vdlp
|
||||
jdbc.password=postgresql_123
|
||||
|
||||
# Información sobre la Base de datos MongoDB
|
||||
mongodb.url=mongodb://admin:mongodb_123@192.168.1.36:27017
|
||||
mongodb.url=mongodb://localhost:27017/
|
||||
mongodb.bbdd=formacionfp_dam2
|
||||
|
||||
#ruta URL formaciones
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory>
|
||||
<property name="connection.url">jdbc:mysql://192.168.1.36:3306/formacionfp_dam2</property>
|
||||
<property name="connection.url">jdbc:mysql://10.11.218.147:3306/formacionfp_dam2</property>
|
||||
<property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
|
||||
|
||||
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user