Commit inicial
This commit is contained in:
commit
64276be426
57
.classpath
Normal file
57
.classpath
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="target/generated-sources/annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/bin/
|
||||
*.class
|
||||
/target/
|
||||
34
.project
Normal file
34
.project
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>eedd_ra3_ejemplo3</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1772465433562</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
2
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
2
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.apt.aptEnabled=false
|
||||
9
.settings/org.eclipse.jdt.core.prefs
Normal file
9
.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
4
.settings/org.eclipse.m2e.core.prefs
Normal file
4
.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
7
pom.xml
Normal file
7
pom.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.lapaloma.concesionario</groupId>
|
||||
<artifactId>aadd_concesionario</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
</project>
|
||||
22
src/main/java/org/lapaloma/hogwarts/AppHogwarts.java
Normal file
22
src/main/java/org/lapaloma/hogwarts/AppHogwarts.java
Normal file
@ -0,0 +1,22 @@
|
||||
package org.lapaloma.hogwarts;
|
||||
|
||||
/**
|
||||
*
|
||||
* AppConcesionario: Clase que realiza el tratamiento de los coches de un
|
||||
* concesionario.
|
||||
*
|
||||
* @author Isidoro Nevares Martín - IES Virgen de la Paloma
|
||||
* @date 4 dic 2025
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class AppHogwarts {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
AppHogwarts app = new AppHogwarts();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.lapaloma.hogwarts.service;
|
||||
|
||||
import org.lapaloma.hogwarts.vo.Alumno;
|
||||
|
||||
/**
|
||||
* Isidoro Nevares Martín - Virgen de la Paloma
|
||||
* Fecha creación: 9 mar 2026
|
||||
*/
|
||||
public class AlumnoService {
|
||||
public boolean esMayorDeEdad(Alumno alumno) {
|
||||
// TODO: devolver true si el alumno tiene 18 años o más
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean telefonoValido(Alumno alumno) {
|
||||
// TODO: comprobar que el teléfono tiene exactamente 9 dígitos
|
||||
return false;
|
||||
}
|
||||
|
||||
public String nombreCompleto(Alumno alumno) {
|
||||
// TODO: devolver "nombre apellido1 apellido2"
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean esRepetidor(Alumno alumno) {
|
||||
// TODO: devolver true si el campo esRepetidor es "sí"
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean alumnoTieneCasa(Alumno alumno) {
|
||||
// TODO: devolver true si el alumno tiene una casa asignada
|
||||
return false;
|
||||
}
|
||||
|
||||
public String obtenerNombreCasa(Alumno alumno) {
|
||||
// TODO: devolver el nombre de la casa o "Sin casa" si no tiene
|
||||
return "";
|
||||
}
|
||||
}
|
||||
12
src/main/java/org/lapaloma/hogwarts/service/CasaService.java
Normal file
12
src/main/java/org/lapaloma/hogwarts/service/CasaService.java
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.lapaloma.hogwarts.service;
|
||||
|
||||
/**
|
||||
* Isidoro Nevares Martín - Virgen de la Paloma
|
||||
* Fecha creación: 9 mar 2026
|
||||
*/
|
||||
public class CasaService {
|
||||
|
||||
}
|
||||
97
src/main/java/org/lapaloma/hogwarts/vo/Alumno.java
Normal file
97
src/main/java/org/lapaloma/hogwarts/vo/Alumno.java
Normal file
@ -0,0 +1,97 @@
|
||||
package org.lapaloma.hogwarts.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Alumno: Clase de persistencia que representa un Alumno de una casa.
|
||||
*
|
||||
* @author Isidoro Nevares Martín - IES Virgen de la Paloma
|
||||
* @date 03 marzo 2026
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Alumno {
|
||||
private int identificador;
|
||||
String nombre;
|
||||
private String apellido1;
|
||||
private String apellido2;
|
||||
private LocalDate fechaNacimiento;
|
||||
private String esRepetidor;
|
||||
private String telefono;
|
||||
private Casa casa;
|
||||
|
||||
|
||||
|
||||
public int getIdentificador() {
|
||||
return identificador;
|
||||
}
|
||||
|
||||
public void setIdentificador(int identificador) {
|
||||
this.identificador = identificador;
|
||||
}
|
||||
|
||||
public String getNombre() {
|
||||
return nombre;
|
||||
}
|
||||
|
||||
public void setNombre(String nombre) {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
public String getApellido1() {
|
||||
return apellido1;
|
||||
}
|
||||
|
||||
public void setApellido1(String apellido1) {
|
||||
this.apellido1 = apellido1;
|
||||
}
|
||||
|
||||
public String getApellido2() {
|
||||
return apellido2;
|
||||
}
|
||||
|
||||
public void setApellido2(String apellido2) {
|
||||
this.apellido2 = apellido2;
|
||||
}
|
||||
|
||||
public LocalDate getFechaNacimiento() {
|
||||
return fechaNacimiento;
|
||||
}
|
||||
|
||||
public void setFechaNacimiento(LocalDate fechaNacimiento) {
|
||||
this.fechaNacimiento = fechaNacimiento;
|
||||
}
|
||||
|
||||
public String getEsRepetidor() {
|
||||
return esRepetidor;
|
||||
}
|
||||
|
||||
public void setEsRepetidor(String esRepetidor) {
|
||||
this.esRepetidor = esRepetidor;
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return telefono;
|
||||
}
|
||||
|
||||
public void setTelefono(String telefono) {
|
||||
this.telefono = telefono;
|
||||
}
|
||||
|
||||
public Casa getCasa() {
|
||||
return casa;
|
||||
}
|
||||
|
||||
public void setCasa(Casa casa) {
|
||||
this.casa = casa;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Alumno [identificador=" + identificador + ", nombre=" + nombre + ", apellido1=" + apellido1
|
||||
+ ", apellido2=" + apellido2 + ", fechaNacimiento=" + fechaNacimiento + ", esRepetidor=" + esRepetidor
|
||||
+ ", telefono=" + telefono + ", casa=" + casa + "]";
|
||||
}
|
||||
|
||||
}
|
||||
36
src/main/java/org/lapaloma/hogwarts/vo/Casa.java
Normal file
36
src/main/java/org/lapaloma/hogwarts/vo/Casa.java
Normal file
@ -0,0 +1,36 @@
|
||||
package org.lapaloma.hogwarts.vo;
|
||||
|
||||
/**
|
||||
*
|
||||
* Casa: Clase de persistencia que representa una Casa de Hogwarts.
|
||||
*
|
||||
* @author Isidoro Nevares Martín - IES Virgen de la Paloma
|
||||
* @date 03 marzo 2026
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Casa {
|
||||
private int identificador;
|
||||
String nombre;
|
||||
|
||||
|
||||
|
||||
public int getIdentificador() {
|
||||
return identificador;
|
||||
}
|
||||
public void setIdentificador(int identificador) {
|
||||
this.identificador = identificador;
|
||||
}
|
||||
public String getNombre() {
|
||||
return nombre;
|
||||
}
|
||||
public void setNombre(String nombre) {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Casa [identificador=" + identificador + ", nombre=" + nombre + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
67
src/main/resources/META-INF/persistence.xml
Normal file
67
src/main/resources/META-INF/persistence.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://xmlns.jcp.org/xml/ns/persistence
|
||||
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
|
||||
version="2.1">
|
||||
|
||||
<persistence-unit name="UP_CONCESIONARIO_ODB" transaction-type="RESOURCE_LOCAL">
|
||||
<!-- Proveedor de persistencia JPA -->
|
||||
<provider>com.objectdb.jpa.Provider</provider>
|
||||
|
||||
<!-- Clases a "mapear" -->
|
||||
<class>org.lapaloma.concesionario.vo.Coche</class>
|
||||
|
||||
<!-- Configuración de propiedades del SGDB (ObjectDB)-->
|
||||
<properties>
|
||||
<property name="jakarta.persistence.jdbc.url" value="objectdb://localhost/Cocensionario.odb" />
|
||||
<property name="jakarta.persistence.jdbc.user" value="admin"/>
|
||||
<property name="jakarta.persistence.jdbc.password" value="admin"/>
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
|
||||
<persistence-unit name="UP_CONCESIONARIO_MYSQL" transaction-type="RESOURCE_LOCAL">
|
||||
<!-- Proveedor de persistencia JPA -->
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
|
||||
<!-- Clases a "mapear" -->
|
||||
<class>org.lapaloma.concesionario.vo.Coche</class>
|
||||
|
||||
<!-- Configuración de propiedades del SGDB (MySQL) -->
|
||||
<properties>
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://192.168.1.36:3306/Concesionario"/>
|
||||
<property name="jakarta.persistence.jdbc.user" value="root"/>
|
||||
<property name="jakarta.persistence.jdbc.password" value="mysql_123"/>
|
||||
<property name="jakarta.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
|
||||
|
||||
<!-- Configuración Hibernate -->
|
||||
<property name="hibernate.hbm2ddl.auto" value="none"/>
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
</properties>
|
||||
|
||||
</persistence-unit>
|
||||
|
||||
<persistence-unit name="UP_CONCESIONARIO_POSTGRESQL" transaction-type="RESOURCE_LOCAL">
|
||||
<!-- Proveedor de persistencia JPA -->
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
|
||||
<!-- Clases a "mapear" -->
|
||||
<class>org.lapaloma.concesionario.vo.Coche</class>
|
||||
|
||||
<!-- Configuración de propiedades del SGDB (PostgreSQL) -->
|
||||
<properties>
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://192.168.1.36:5432/Concesionario"/>
|
||||
<property name="jakarta.persistence.jdbc.user" value="vdlp"/>
|
||||
<property name="jakarta.persistence.jdbc.password" value="postgresql_123"/>
|
||||
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
||||
|
||||
<!-- Configuración Hibernate -->
|
||||
<property name="hibernate.hbm2ddl.auto" value="none"/>
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
</properties>
|
||||
|
||||
</persistence-unit>
|
||||
|
||||
|
||||
</persistence>
|
||||
24
src/main/resources/hibernate.cfg.xml
Normal file
24
src/main/resources/hibernate.cfg.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC
|
||||
"-//Hibernate/Hibernate Configuration DTD//EN"
|
||||
"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/Concesionario</property>
|
||||
<property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
|
||||
|
||||
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
|
||||
|
||||
<property name="connection.username">root</property>
|
||||
<property name="connection.password">mysql_123</property>
|
||||
|
||||
<!-- DB schema will be updated if needed -->
|
||||
<property name="hbm2ddl.auto">none</property>
|
||||
<property name="show_sql">false</property>
|
||||
<property name="format_sql">true</property>
|
||||
|
||||
<mapping class="org.lapaloma.concesionario.vo.Coche"></mapping>
|
||||
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
Loading…
Reference in New Issue
Block a user