Package ejava.jpa.example.validation
Class PurchaseItem
- java.lang.Object
-
- ejava.jpa.example.validation.PurchaseItem
-
-
Field Summary
Fields Modifier and Type Field Description private @NotNull(message="item amount is required") BigDecimalamountprivate @javax.validation.constraints.Min(value=1L, message="item count is required") intcountprivate @NotNull(message="item description is required") @Size(max=20,message="description too large") Stringdescriptionprivate intid
-
Constructor Summary
Constructors Constructor Description PurchaseItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimalgetAmount()intgetCount()StringgetDescription()intgetId()BigDecimalgetTotal()PurchaseItemsetAmount(BigDecimal amount)PurchaseItemsetCount(int count)PurchaseItemsetDescription(String description)StringtoString()
-
-
-
Field Detail
-
id
private int id
-
description
@NotNull(message="item description is required") @Size(max=20, message="description too large") private @NotNull(message="item description is required") @Size(max=20,message="description too large") String description
-
amount
@NotNull(message="item amount is required") private @NotNull(message="item amount is required") BigDecimal amount
-
count
@Min(value=1L, message="item count is required") private @javax.validation.constraints.Min(value=1L, message="item count is required") int count
-
-
Method Detail
-
getId
public int getId()
-
getDescription
public String getDescription()
-
setDescription
public PurchaseItem setDescription(String description)
-
getAmount
public BigDecimal getAmount()
-
setAmount
public PurchaseItem setAmount(BigDecimal amount)
-
getCount
public int getCount()
-
setCount
public PurchaseItem setCount(int count)
-
getTotal
public BigDecimal getTotal()
-
-