Package com.proyecto.jpa.entity
Class OrderItem
java.lang.Object
com.proyecto.jpa.entity.OrderItem
- All Implemented Interfaces:
Serializable
Entidad que representa un Item de Pedido.
Demuestra relaciones @ManyToOne con Order y Product.
Esta clase actúa como tabla intermedia entre Order y Product,
permitiendo almacenar información adicional (cantidad, precio unitario, subtotal).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleangetId()getOrder()inthashCode()protected voidonSave()voidvoidvoidsetProduct(Product product) voidsetQuantity(Integer quantity) voidsetSubtotal(BigDecimal subtotal) voidsetUnitPrice(BigDecimal unitPrice) toString()
-
Constructor Details
-
OrderItem
public OrderItem() -
OrderItem
-
-
Method Details
-
calculateSubtotal
public void calculateSubtotal() -
onSave
protected void onSave() -
getId
-
setId
-
getOrder
-
setOrder
-
getProduct
-
setProduct
-
getQuantity
-
setQuantity
-
getUnitPrice
-
setUnitPrice
-
getSubtotal
-
setSubtotal
-
equals
-
hashCode
public int hashCode() -
toString
-