This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.parzibyte.sistemaventasspringboot; | |
import javax.persistence.*; | |
@Entity | |
public class ProductoVendido { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Integer id; | |
private Float cantidad, precio; | |
private String nombre, codigo; | |
@ManyToOne | |
@JoinColumn | |
private Venta venta; | |
public ProductoVendido(Float cantidad, Float precio, String nombre, String codigo, Venta venta) { | |
this.cantidad = cantidad; | |
this.precio = precio; | |
this.nombre = nombre; | |
this.codigo = codigo; | |
this.venta = venta; | |
} | |
public ProductoVendido() { | |
} | |
public Float getTotal() { | |
return this.cantidad * this.precio; | |
} | |
public Venta getVenta() { | |
return venta; | |
} | |
public void setVenta(Venta venta) { | |
this.venta = venta; | |
} | |
public Float getPrecio() { | |
return precio; | |
} | |
public void setPrecio(Float precio) { | |
this.precio = precio; | |
} | |
public Float getCantidad() { | |
return cantidad; | |
} | |
public void setCantidad(Float cantidad) { | |
this.cantidad = cantidad; | |
} | |
public String getNombre() { | |
return nombre; | |
} | |
public void setNombre(String nombre) { | |
this.nombre = nombre; | |
} | |
public String getCodigo() { | |
return codigo; | |
} | |
public void setCodigo(String codigo) { | |
this.codigo = codigo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment