Skip to content

Commit

Permalink
cambios entities
Browse files Browse the repository at this point in the history
  • Loading branch information
juandirodrib12 committed Oct 3, 2024
1 parent 40aaac5 commit f677900
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions documentacion/Base_Datos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ ALTER TABLE sucursal ADD CONSTRAINT sucursal_ciudad_fk FOREIGN KEY ( ciudad_id )

-- Restricciones de las tablas
-- Unique
ALTER TABLE bodega
ADD CONSTRAINT unique_bodega_nombre UNIQUE (nombre);

ALTER TABLE categoria
ADD CONSTRAINT unique_categoria_nombre UNIQUE (nombre);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Table(name = "categoria")
public class Categoria extends BaseEntity {

@Column(name = "nombre", nullable = false)
@Column(name = "nombre", nullable = false, unique = true, updatable = false)
private String nombre;

@Column(name = "descripcion", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Table(name = "ciudad")
public class Ciudad extends BaseEntity {

@Column(name = "nombre", nullable = false)
@Column(name = "nombre", nullable = false, unique = true, updatable = false)
private String nombre;
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Table(name = "ordencompra")
public class OrdenCompra extends BaseEntity {

@Column(name = "fechacreacion", nullable = false)
@Column(name = "fechacreacion", nullable = false, updatable = false)
private LocalDate fechaCreacion;

@Column(name = "fechaentrega", nullable = false)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/uniandes/edu/co/proyecto/entities/Producto.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Table(name = "producto")
public class Producto extends BaseEntity {

@Column(name = "nombre", nullable = false)
@Column(name = "nombre", nullable = false, unique = true)
private String nombre;

@Column(name = "costobodega", nullable = false)
Expand All @@ -37,10 +37,10 @@ public class Producto extends BaseEntity {
@Column(name = "pesoempaque", nullable = false)
private double pesoEmpaque;

@Column(name = "fechaexpiracion")
@Column(name = "fechaexpiracion", updatable = false)
private LocalDate fechaVencimiento;

@Column(name = "codigobarras", nullable = false)
@Column(name = "codigobarras", nullable = false, unique = true, updatable = false)
private String codigoBarras;

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
@Table(name = "proveedor")
public class Proveedor extends BaseEntity {

@Column(name = "nit", nullable = false)
@Column(name = "nit", nullable = false, unique = true, updatable = false)
private Long nit;

@Column(name = "nombre", nullable = false)
@Column(name = "nombre", nullable = false, unique = true)
private String nombre;

@Column(name = "direccion", nullable = false)
Expand All @@ -22,7 +22,7 @@ public class Proveedor extends BaseEntity {
@Column(name = "nombrecontacto", nullable = false)
private String nombreContacto;

@Column(name = "telefonocontacto", nullable = false)
@Column(name = "telefonocontacto", nullable = false, unique = true)
private Long telefonoContacto;
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Sucursal extends BaseEntity {
@Column(name = "direccion", nullable = false)
private String direccion;

@Column(name = "telefono", nullable = false)
@Column(name = "telefono", nullable = false, unique = true)
private Long telefono;

@Column(name = "tamano", nullable = false)
Expand Down

0 comments on commit f677900

Please sign in to comment.