Skip to main content

Documentation 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.

The entidad module (mx.desarollo.entity) contains every Jakarta Persistence entity that makes up the SiCom data model. Hibernate 6 is configured with hibernate.hbm2ddl.auto=validate, so it verifies each entity’s mapping against the live MySQL 8 schema on every application startup — the schema must already exist before the server boots. The persistence unit persistencePU declares all twelve entity classes explicitly and uses a HikariCP connection pool (min 5, max 10 connections) against the sicom database.

Articulo

Table: articulo — represents a single rentable item in the catalog.
FieldJava TypeColumnNullableNotes
idIntegeridarticuloNo (PK)Auto-generated identity
nombreStringnombreNoMax 80 chars; catalog display name
categoriaCategoriacategoriaNoStored as EnumType.STRING, max 10 chars
precioBigDecimalprecioNoDECIMAL(10,2) — unit rental price
unidadesIntegerunidadesNoTotal physical units in warehouse
activobooleanactivoNoDefault true; false hides item from catalog
imagenImagenimagen_id (FK)No@OneToOne lazy-fetch; unique FK
formaFormaformaYesMax 12 chars; only meaningful for MESA or UNIVERSAL articles
textilTipoTextilTipotextil_tipoYesMax 10 chars; only set when categoria = TEXTIL
Relationships:
imagen
Imagen
required
@OneToOne(fetch = FetchType.LAZY, optional = false) — every article must have exactly one image. The FK column imagen_id carries a unique constraint.

Imagen

Table: imagen — stores article photos as raw binary blobs.
FieldJava TypeColumnNullableNotes
idLongid_imagenNo (PK)Auto-generated identity
datosbyte[]datosNoLONGBLOB — raw image bytes
mimeStringmimeNoMax 50 chars; e.g. image/png, image/jpeg
Imagen has no outbound relationships. It is owned by Articulo and CombinacionMesa through their respective @OneToOne mappings.

Renta

Table: renta — the central rental/quotation record.
FieldJava TypeColumnNullableNotes
idIntegeridRentaNo (PK)Auto-generated identity
estadoStringestadoNoMax 45 chars; drives the state machine (see Rental States)
idClienteClienteidCliente (FK)No@ManyToOne lazy, CascadeType.MERGE; ON DELETE CASCADE
horaLocalTimehoraYesRequested delivery time
fechaInicioLocalDatefecha_inicioYesStart date of the rental period; added via migration
fechaLocalDatefechaYesEnd / event date of the rental period
idEmpleadoEmpleadoidEmpleado (FK)Yes@OneToOne lazy; assigned when entering delivery/collection flow; ON DELETE CASCADE
entregadoStringEntregadoYesMax 45 chars; delivery confirmation label
recogidoStringRecogidoYesMax 45 chars; collection confirmation label
totalBigDecimaltotalNoDECIMAL(10,2) — sum of all line totals
detallesRentaList<Detallerenta>@OneToMany(mappedBy="idrenta"), CascadeType.ALL, orphanRemoval=true, ordered by id ASC
Relationships:
idCliente
Cliente
required
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE) — many rentals can belong to the same client. Hibernate will cascade merge operations to the client record.
idEmpleado
Empleado
@OneToOne(fetch = FetchType.LAZY) — nullable; set when an employee is assigned to handle delivery or collection.
detallesRenta
List<Detallerenta>
@OneToMany(cascade = ALL, orphanRemoval = true) — child line items are fully owned by the rental. Removing a Detallerenta from the list and merging the parent deletes the row.

Detallerenta

Table: detallerenta — a single line item within a rental.
FieldJava TypeColumnNullableNotes
idIntegeriddetalleNo (PK)Auto-generated identity
idrentaRentaidrenta (FK)No@ManyToOne lazy; ON DELETE CASCADE
idarticuloArticuloidarticulo (FK)No@ManyToOne lazy; the rented article
cantidadIntegercantidadNoNumber of units requested
precioUnitarioBigDecimalprecio_unitarioNoDECIMAL(10,2) — unit price snapshotted at quotation time
precioTotalBigDecimalprecio_totalNoDECIMAL(10,2)cantidad × precioUnitario
Relationships:
idrenta
Renta
required
@ManyToOne(fetch = FetchType.LAZY, optional = false) — back-reference to the parent rental. ON DELETE CASCADE ensures orphan rows are removed by the database if the parent rental is deleted directly via SQL.
idarticulo
Articulo
required
@ManyToOne(fetch = FetchType.LAZY, optional = false) — reference to the catalog article. Prices are snapshotted at quotation time, so precioUnitario does not change even if Articulo.precio is later updated.

Cliente

Table: cliente — an end-customer who places rentals.
FieldJava TypeColumnNullableNotes
idIntegeridClienteNo (PK)Auto-generated identity
nombreStringnombreNoMax 45 chars
telefonoStringtelefonoNoMax 45 chars; stored as plain text
direccionStringdireccionNoMax 45 chars; delivery address
Cliente carries no direct relationships; it is referenced by Renta through @ManyToOne.

Empleado

Table: empleado — a staff member who can be assigned to rentals.
FieldJava TypeColumnNullableNotes
idIntegeridempleadoNo (PK)Auto-generated identity
nombreStringnombreNoMax 80 chars; given name(s)
apellidoPaternoStringapellido_paternoNoMax 45 chars
apellidoMaternoStringapellido_maternoNoMax 45 chars
correoStringcorreoNoMax 45 chars; unique constraint
contrasenaStringcontrasenaNoMax 255 chars; bcrypt hash
getNombreCompleto()String@Transient computed property: nombre + apellidoPaterno + apellidoMaterno
getNombreCompleto()
@Transient String
Convenience getter not persisted to the database. Returns the full name as a single space-joined string. Used by the UI to display employee names in rental assignment dialogs.

Administrador

Table: administrador — a privileged platform administrator (separate credential store from Empleado).
FieldJava TypeColumnNullableNotes
idIntegeridAdminNo (PK)Auto-generated identity
correoStringcorreoNoMax 45 chars; login username
contrasenaStringcontrasenaNoMax 100 chars; hashed password
Administrador has no FK relationships; it is a standalone credentials table with no cascade operations.

CombinacionMesa

Table: combinacion_mesa — a curated preset that bundles one table with one or more textile articles for catalog display.
FieldJava TypeColumnNullableNotes
idIntegeridNo (PK)Auto-generated identity
mesaArticulomesa_id (FK)No@ManyToOne lazy; must be a MESA article
mantelArticulomantel_id (FK)No@ManyToOne lazy; must be a TEXTIL/MANTEL article
caminoArticulocamino_id (FK)Yes@ManyToOne lazy; optional TEXTIL/CAMINO article
cubreArticulocubre_id (FK)Yes@ManyToOne lazy; optional TEXTIL/CUBRE article
imagenImagenimagen_id (FK)No@OneToOne lazy; unique FK — composite preview photo
activobooleanactivoNoDefault true; controls catalog visibility
A unique constraint enforces (mesa_id, mantel_id, camino_id, cubre_id) so the same combination cannot appear twice.

MovimientoAlmacen

Table: movimiento_almacen — an immutable audit log of every warehouse entry or exit.
FieldJava TypeColumnNullableNotes
idIntegeridNo (PK)Auto-generated identity
articuloArticuloidarticulo (FK)No@ManyToOne lazy; the affected article
rentaRentaidrenta (FK)Yes@ManyToOne lazy; nullable for non-rental movements
fechaLocalDatefechaNoCalendar date of the movement
fechaHoraRegistroLocalDateTimefecha_hora_registroNoExact timestamp of registration
tipoMovimientoTipoMovimientotipo_movimientoNoEnumType.STRING, max 10 chars; ENTRADA or SALIDA
cantidadIntegercantidadNoNumber of units moved
precioUnitarioBigDecimalprecio_unitarioNoDECIMAL(10,2) — unit price at movement time
conceptoStringconceptoYesMax 200 chars; free-text description

StockDiario

Table: stock_diario — a daily snapshot of an article’s inventory levels.
FieldJava TypeColumnNullableNotes
idIntegeridNo (PK)Auto-generated identity
articuloArticuloidarticulo (FK)No@ManyToOne lazy
fechaLocalDatefechaNoThe date this snapshot covers
inventarioInicialIntegerinventario_inicialNoStock count at the start of the day
existenciaFinalIntegerexistencia_finalNoStock count at the end of the day
A unique constraint on (idarticulo, fecha) ensures at most one snapshot row per article per day.

StockReservadoDiario

Table: stock_reservado_diario — per-article, per-day reservation totals written by the cambiar_estado_renta stored procedure.
FieldJava TypeColumnNullableNotes
idLongid_stock_reservadoNo (PK)Auto-generated identity
idarticuloArticuloidarticulo (FK)No@ManyToOne lazy; ON DELETE CASCADE
fechaLocalDatefechaNoThe reserved date
cantidadReservadaIntegercantidad_reservadaNoINT UNSIGNED; accumulated reserved units for this article on this date
Rows are upserted (inserted or ON DUPLICATE KEY UPDATE) by the stored procedure whenever a rental transitions from Solicitada to Aprobada or Confirmado. See Stock Management for the full reservation lifecycle.

Comentario

Table: comentarios — a delivery or collection note attached to a rental.
FieldJava TypeColumnNullableNotes
idIntegeridComentarioNo (PK)Auto-generated identity
tipoStringtipoNoMySQL ENUM('Entrega','Recoleccion')
comentarioStringcomentarioYesTEXT — free-form note body
idRentaRentaidRenta (FK)No@ManyToOne lazy; ON DELETE CASCADE
tipo
String
required
Constrained at the database level to exactly two values: Entrega (written after the delivery state) and Recoleccion (written after the collection state). The application UI enforces this via PrimeFaces dialog logic in RentaBeanUI.

Enums

Categoria

Stored as VARCHAR(10) via @Enumerated(EnumType.STRING) on Articulo.categoria.
ValueDescription
MESATables (combined with textiles in CombinacionMesa)
TEXTILTablecloths, runners, and chair covers
SILLAChairs
CARPAEvent canopies / tents
COOLERBeverage coolers
CALENTONOutdoor heaters

Forma

Stored as VARCHAR(12) via @Enumerated(EnumType.STRING) on Articulo.forma. Only meaningful for MESA articles and combined-preset catalog filtering.
ValueDescription
REDONDARound table
RECTANGULARRectangular table
UNIVERSALShape-agnostic; applicable to any table type

TextilTipo

Stored as VARCHAR(10) via @Enumerated(EnumType.STRING) on Articulo.textilTipo. Must be null for non-TEXTIL articles.
ValueDescription
MANTELFull tablecloth
CAMINOTable runner
CUBREChair cover

TipoMovimiento

Stored as VARCHAR(10) via @Enumerated(EnumType.STRING) on MovimientoAlmacen.tipoMovimiento.
ValueDescription
ENTRADAStock arriving — purchase returns or new inventory
SALIDAStock leaving — rental dispatch or write-off

Build docs developers (and LLMs) love