Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parzibyte/4e63ca104cc5dc6b586ab489a8916aad to your computer and use it in GitHub Desktop.
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