Instituto Formacion
This commit is contained in:
parent
3b06e360c5
commit
9e9b41e917
@ -26,7 +26,7 @@
|
|||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
<attribute name="maven.pomderived" 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.
|
// Si el registro es de tipo "S" se tratará para insertarse en la Base de datos.
|
||||||
if (registroATratar.equals("S")) {
|
if (registroATratar.equals("S")) {
|
||||||
InstitutoFormacion institutoFormacion = new InstitutoFormacion();
|
InstitutoFormacion institutoFormacion = new InstitutoFormacion();
|
||||||
InstitutoFormacionID institutoFormacionID = new InstitutoFormacionID(idInstituto, codFormacion);
|
InstitutoFormacionID institutoFormacionID = new InstitutoFormacionID(idInstituto, codFormacion,anyo);
|
||||||
|
|
||||||
Instituto instituto = new Instituto();
|
Instituto instituto = new Instituto();
|
||||||
instituto.setIdentificador(idInstituto);
|
instituto.setIdentificador(idInstituto);
|
||||||
@ -61,7 +61,6 @@ public class ProcesadorFormacionInstitutoCSV {
|
|||||||
institutoFormacion.setIdInstitutoFormacion(institutoFormacionID);
|
institutoFormacion.setIdInstitutoFormacion(institutoFormacionID);
|
||||||
institutoFormacion.setInstituto(instituto);
|
institutoFormacion.setInstituto(instituto);
|
||||||
institutoFormacion.setFormacion(formacion);
|
institutoFormacion.setFormacion(formacion);
|
||||||
institutoFormacion.setAnyoAcademico(anyo);
|
|
||||||
|
|
||||||
listaInstitutoFormacion.add(institutoFormacion);
|
listaInstitutoFormacion.add(institutoFormacion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,46 +32,31 @@ public class InstitutoFormacion {
|
|||||||
@JoinColumn(name="cod_formacion", insertable=false, updatable=false)
|
@JoinColumn(name="cod_formacion", insertable=false, updatable=false)
|
||||||
private Formacion formacion;
|
private Formacion formacion;
|
||||||
|
|
||||||
@Column(name="anyo_academico")
|
|
||||||
private int anyoAcademico;
|
|
||||||
|
|
||||||
@Embeddable
|
@Embeddable
|
||||||
public static class InstitutoFormacionID{
|
public static class InstitutoFormacionID{
|
||||||
public 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")
|
@Column(name="id_instituto")
|
||||||
private Integer idIntituto;
|
private Integer idIntituto;
|
||||||
|
|
||||||
@Column(name="cod_formacion")
|
@Column(name="cod_formacion")
|
||||||
private String codFormacion;
|
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() {
|
public Integer getIdIntituto() {
|
||||||
return idIntituto;
|
return idIntituto;
|
||||||
}
|
}
|
||||||
@ -84,14 +69,38 @@ public class InstitutoFormacion {
|
|||||||
public void setCodFormacion(String codFormacion) {
|
public void setCodFormacion(String codFormacion) {
|
||||||
this.codFormacion = 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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "InstitutoFormacion [idInstitutoFormacion=" + idInstitutoFormacion + ", instituto=" + instituto
|
return "InstitutoFormacionID [idIntituto=" + idIntituto + ", codFormacion=" + codFormacion
|
||||||
+ ", formacion=" + formacion + ", anyoAcademico=" + anyoAcademico + "]";
|
+ ", anyoAcademico=" + anyoAcademico + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public InstitutoFormacionID getIdInstitutoFormacion() {
|
public InstitutoFormacionID getIdInstitutoFormacion() {
|
||||||
return idInstitutoFormacion;
|
return idInstitutoFormacion;
|
||||||
}
|
}
|
||||||
@ -116,11 +125,10 @@ public class InstitutoFormacion {
|
|||||||
this.formacion = formacion;
|
this.formacion = formacion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAnyoAcademico() {
|
@Override
|
||||||
return anyoAcademico;
|
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 -->
|
<!-- Configuración para la conexión a la Base de Datos -->
|
||||||
<properties>
|
<properties>
|
||||||
<property name="jakarta.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver" />
|
<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.url" value="jdbc:mysql://10.11.218.147:3306/formacionfp_dam2" /> <property name="jakarta.persistence.jdbc.user" value="root" />
|
||||||
<property name="jakarta.persistence.jdbc.user" value="root" />
|
|
||||||
<property name="jakarta.persistence.jdbc.password" value="mysql_123" />
|
<property name="jakarta.persistence.jdbc.password" value="mysql_123" />
|
||||||
|
|
||||||
<property name="hibernate.show_sql" value="true" />
|
<property name="hibernate.show_sql" value="true" />
|
||||||
</properties>
|
</properties>
|
||||||
</persistence-unit>
|
</persistence-unit>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
# Información sobre la Base de datos PostgreSQL
|
# Información sobre la Base de datos PostgreSQL
|
||||||
jdbc.driver=org.postgresql.Driver
|
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.usuario=vdlp
|
||||||
jdbc.password=postgresql_123
|
jdbc.password=postgresql_123
|
||||||
|
|
||||||
# Información sobre la Base de datos MongoDB
|
# 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
|
mongodb.bbdd=formacionfp_dam2
|
||||||
|
|
||||||
#ruta URL formaciones
|
#ruta URL formaciones
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||||
<hibernate-configuration>
|
<hibernate-configuration>
|
||||||
<session-factory>
|
<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="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
|
||||||
|
|
||||||
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
|
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user