SiCom is structured as a four-module Maven project (group IDDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dinogamer089/SiCom/llms.txt
Use this file to discover all available pages before exploring further.
mx.avanti.desarollo, parent artifact guia). Each module owns one well-defined layer of the application: JPA entities, data-access objects, business facades, and JSF views. Dependencies flow strictly downward — the view layer depends on the business layer, which depends on persistence, which depends on the entity model. No layer may reference a higher one, keeping concerns cleanly separated and the codebase independently testable.
Module Overview
| Module | Artifact ID | Root Package | Responsibility |
|---|---|---|---|
| Entity model | entidad | mx.desarollo.entity | JPA @Entity classes, enums, and value objects |
| Persistence | persistencia | mx.avanti.desarollo | AbstractDAO, HibernateUtil, concrete DAOs, ServiceLocator |
| Business | negocio | mx.desarollo | Facade classes, Delegate classes, ServiceFacadeLocator |
| Web / View | vista | ui, helper | CDI @Named beans, Helper classes, JSF XHTML pages, servlets |
maven.compiler.source=21). The vista module is the only one packaged as a WAR; the others produce JARs that are bundled inside it.
Layer Details
entidad — JPA Entity Model
Package:mx.desarollo.entity
The entidad module contains every JPA @Entity class and supporting enums. Hibernate 6 maps these classes to the MySQL schema; Hibernate validates the schema on every startup (hbm2ddl.auto=validate).
Entities registered in persistence.xml:
| Entity | Table | Purpose |
|---|---|---|
Articulo | articulo | Rentable item — name, Categoria, price, stock, active flag, Imagen FK |
Imagen | imagen | Binary image data and MIME type for an article |
Renta | renta | Quotation or rental record — state, dates, client, employee, total |
Detallerenta | detallerenta | Line item of a rental (article + quantity + subtotal) |
Cliente | cliente | Client contact and authentication data |
Empleado | empleado | Employee contact and authentication data |
Administrador | administrador | Administrator credentials |
CombinacionMesa | combinacion_mesa | Preset table-and-linen pairings for quick cart additions |
Comentario | comentario | Notes attached to a rental by any user |
StockDiario | stock_diario | Absolute stock snapshot per article per calendar day |
StockReservadoDiario | stock_reservado_diario | Reserved units per article per day (drives availability checks) |
MovimientoAlmacen | movimiento_almacen | Audit log of stock entries and exits |
Categoria—MESA,TEXTIL,SILLA,CARPA,COOLER,CALENTONForma—REDONDA,RECTANGULAR,UNIVERSALTextilTipo—MANTEL,CAMINO,CUBREMANTELTipoMovimiento— warehouse movement direction
persistencia — Data Access Layer
Package:mx.avanti.desarollo
The persistencia module initializes Hibernate and provides all data-access objects. The central utility class is HibernateUtil, which builds a single EntityManagerFactory from the persistence unit named persistencePU (defined in persistence.xml) and vends short-lived EntityManager instances on demand.
HikariCP connection pooling is configured directly in persistence.xml:
| Property | Value |
|---|---|
hibernate.hikari.minimumIdle | 5 |
hibernate.hikari.maximumPoolSize | 10 |
hibernate.hikari.idleTimeout | 30000 ms |
AbstractDAO<T> is the generic base class for every DAO. It wraps every operation in its own EntityManager + EntityTransaction, commits on success, and rolls back on any RuntimeException. Concrete DAOs extend it and add domain-specific JPQL or native queries:
ArticuloDAO, RentaDAO, ClienteDAO, EmpleadoDAO, AdministradorDAO, CombinacionMesaDAO, DetallerentaDAO, StockDiarioDAO, StockReservadoDAO, MovimientoAlmacenDAO, ComentarioDAO, DashboardDAO
ServiceLocator is a static factory that instantiates each DAO with a fresh EntityManager obtained from HibernateUtil. It is the only class in the persistence layer that the business layer calls directly.
negocio — Business / Facade Layer
Package:mx.desarollo
The negocio module provides two sub-layers per feature domain: a Facade and a Delegate. This pattern allows business rules (validation, state transitions, aggregation) to live in the Facade while the Delegate owns the wiring to ServiceLocator.
Facade classes:
| Facade | Responsibility |
|---|---|
FacadeArticulo | Catalog CRUD, soft-delete on constraint violation, duplicate-name guard |
FacadeRenta | Quotation registration, state machine transitions, rental updates with stock recalculation |
FacadeDashboard | Aggregated metrics, funnel data, top-article ranking, client-growth series |
FacadeEmpleado | Employee CRUD and lookup |
FacadeCarrito | Shopping-cart session logic and quote submission |
FacadeCombinacionMesa | Preset table-linen combination management |
FacadeTarjetaAlmacen | Warehouse card views and movement registration |
FacadeLogin | Authentication for both Administrador and Empleado entities |
ServiceLocator calls and translate between business objects and DAO parameters:
DelegateArticulo, DelegateRenta, DelegateEmpleado, DelegateCarrito, DelegateCombinacionMesa, DelegateTarjetaAlmacen, DelegateDashboard, DelegateLogin
ServiceFacadeLocator is a lazy-initializing static registry that vends singleton Facade instances to the view layer, mirroring the role that ServiceLocator plays for DAOs.
vista — Web / View Layer
Package:ui (CDI beans), helper (intermediate helpers), config (listeners), upload (servlet)
The vista module is the only deployable artifact (WAR). It contains:
- CDI
@Namedmanaged beans in theuipackage — one per screen or feature, annotated@SessionScopedor@RequestScoped, named for EL expression binding in XHTML pages - Helper classes in the
helperpackage — plain Java objects that translate between UI data transfer objects (DTOs) and Facade calls, keeping beans thin - XHTML views — PrimeFaces 14 component pages mapped to
*.xhtmlby the Faces Servlet UploadImageServlet— handles multipart image uploads outside the JSF lifecycle for large binary payloadsUploadInitListener— aServletContextListenerthat pre-configures the upload directory at application startup
@Named beans:
LoginBeanUI, ArticuloBeanUI, ArticuloCatalogoBeanUI, CarritoBean, RentaBeanUI, EmpleadoBeanUI, EmpleadoRentaBeanUI, DashboardBeanUI, DashboardRentasBeanUI, DashboardCotizacionesBeanUI, DashboardClientesBeanUI, CombinacionMesaAdminBeanUI, CombinacionMesaClienteBeanUI, TarjetaAlmacenBeanUI, ContactoBean
Request Flow
A user action in the browser travels through every layer before reaching MySQL:Code Example — Bean → Helper → Facade
The following excerpt shows the real pattern used across the application.ArticuloBeanUI stays free of Facade imports; it only knows about ArticuloHelper. The helper calls ServiceFacadeLocator to reach the Facade, which in turn calls the Delegate and DAO.
The persistence unit is named
persistencePU (declared in persistencia/src/main/resources/META-INF/persistence.xml). HibernateUtil bootstraps this unit once at class-loading time and shares the EntityManagerFactory for the lifetime of the application. Hibernate is configured with hbm2ddl.auto=validate, which means it checks that the database schema matches the entity mappings on every startup but never modifies the schema automatically. If the schema is missing or out of date, the application will fail to start — run the SQL migration scripts first.What’s Next
Entity Reference
Full field-by-field reference for every JPA entity and enum.
DAO Layer
AbstractDAO API and custom query methods in each concrete DAO.
Facade API
Public methods of every Facade class and their business rules.
Rental States
Complete state machine diagram and allowed transitions.