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") BigDecimal
amount
private @javax.validation.constraints.Min(value=1L, message="item count is required") int
count
private @NotNull(message="item description is required") @Size(max=20,message="description too large") String
description
private int
id
-
Constructor Summary
Constructors Constructor Description PurchaseItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
getAmount()
int
getCount()
String
getDescription()
int
getId()
BigDecimal
getTotal()
PurchaseItem
setAmount(BigDecimal amount)
PurchaseItem
setCount(int count)
PurchaseItem
setDescription(String description)
String
toString()
-
-
-
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()
-
-