|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectshared.PersistentBase
ch7.catalog.CatalogItem
public class CatalogItem
A bean that represents an item in the catalog database.
| Field Summary |
|---|
| Fields inherited from class shared.PersistentBase |
|---|
id |
| Constructor Summary | |
|---|---|
CatalogItem()
Creates a new instance of CatalogItem |
|
CatalogItem(java.lang.String itemId,
java.lang.String name,
java.lang.String description,
double price)
Non-default constructor that initialises all the fields. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDescription()
Accessor for the description. |
java.lang.String |
getItemId()
Accessor for the item ID. |
java.lang.String |
getName()
Accessor for the name. |
double |
getPrice()
Accessor for the price. |
void |
setDescription(java.lang.String description)
Mutator for the description. |
void |
setItemId(java.lang.String itemId)
Mutator for the item ID. |
void |
setName(java.lang.String name)
The mutator for the name. |
void |
setPrice(double price)
Mutator for the price. |
| Methods inherited from class shared.PersistentBase |
|---|
getId, setId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CatalogItem()
public CatalogItem(java.lang.String itemId,
java.lang.String name,
java.lang.String description,
double price)
itemId - The item IDname - The name of the bookdescription - The description of the bookprice - The price of the book| Method Detail |
|---|
@Length(min=1,
max=50)
public java.lang.String getName()
It is annotated with the Length attribute, to give Hibernate a hint about how big to make the column in the database.
public void setName(java.lang.String name)
name - Element data from the requestpublic java.lang.String getDescription()
It is annotated with the Lob annotation, to give Hibernate a hint that this is a large binary object. Hibernate will use this information to allow arbitrarily large amounts of data to be stored in the column.
public void setDescription(java.lang.String description)
description - Element data from the request
@NotNull
@Length(min=1,
max=10)
public java.lang.String getItemId()
The ID cannot be null and must be no longer than ten characters.
It is annotated with the Length attribute, to give Hibernate a hint about how big to make the column in the database.
public void setItemId(java.lang.String itemId)
itemId - Element data from the requestpublic double getPrice()
public void setPrice(double price)
price - Element data from the request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||