How pedrobaonza/proyecto-hibernate works
Project type and purpose
• From the file tree and README, this is a Java-based console application to manage “empleados” (employees), “departamentos” (departments), “clientes” and “proyectos” using Hibernate ORM with XML mappings.
• It provides an interactive menu (MenusPrograma) to let a user perform CRUD operations on those entities, calculate/report data, and persist/retrieve them from a relational database.
File structure
• Top-level directories:
• bin – compiled .class files, Hibernate XML mappings (modelo/*.hbm.xml), hibernate.cfg.xml, reveng.xml
• librerias – external JARs (Hibernate core, annotations, persistence API, etc.)
• src – application source code and resources
– src/launcherAPP – entry point (MainApp), Hibernate connection (ConexionHibernate), program controller (ControladorPrograma)
– src/funciones – UI menus (MenusPrograma), input handling (PeticionDatos), business logic (ProcesadoHibernateEmpleado, ProcesadoHibernateDepartamentos, Validaciones)
– src/modelo – domain model (Java POJOs + .hbm.xml mappings for Clientes, Departamentos, Empleados, Proyectos)
– src/hibernate.cfg.xml, hibernate.reveng.xml – Hibernate configuration and reverse-engineering settings
• Patterns:
• Layered architecture (Presentation → Business Logic → Persistence)
• DAO-style services encapsulated in ProcesadoHibernate* classes
• ORM mapping with Hibernate XML (model/*.hbm.xml)
• No web or network layers – it’s a local console application connecting directly to a database via JDBC/Hibernate.
README for additional insights
• Describes XML and binary file handling, but the actual code tree shows Hibernate + DB usage. Likely the README was repurposed; the core is ORM-based persistence.
• Interactive menu, exception handling, computing of metrics (e.g., “medias de notas” in README maps to computing averages or summaries here).
Essential details to capture
• The separation of layers: UI, Controller, Service, Persistence, DB
• The Hibernate Session lifecycle: SessionFactory initialization → Session
• Mapping files (.hbm.xml) linking Java POJOs to DB tables
• Libraries providing ORM functionality
• Exception handling flow (services catching and propagating errors back to the UI)