ch7.catalog
Class CatalogItem

java.lang.Object
  extended by shared.PersistentBase
      extended by ch7.catalog.CatalogItem

public class CatalogItem
extends PersistentBase

The bean that encapsulates a catalog item. The description is designed to hold a lot of data, so it is annotated as a Large Object.


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 itemName, java.lang.String description, double price)
          Creates a new instance of CatalogItem, initilialising all the member variables.
 
Method Summary
 java.lang.String getDescription()
          Accessor for the description element.
 java.lang.String getItemId()
          Accessor for the itemId element.
 java.lang.String getItemName()
          Accessor for the itemName element.
 double getPrice()
          Accessor for the price element.
 void setDescription(java.lang.String description)
          Mutator for the description element.
 void setItemId(java.lang.String itemId)
          Mutator for the itemId element.
 void setItemName(java.lang.String itemName)
          Mutator for the itemName element.
 void setPrice(double price)
          Mutator for the price element.
 
Methods inherited from class shared.PersistentBase
getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogItem

public CatalogItem()
Creates a new instance of CatalogItem


CatalogItem

public CatalogItem(java.lang.String itemId,
                   java.lang.String itemName,
                   java.lang.String description,
                   double price)
Creates a new instance of CatalogItem, initilialising all the member variables.

Parameters:
itemId - The initial value for the itemId.
itemName - The initial value for the itemName.
description - The initial value for the description.
price - The initial value for the price.
Method Detail

getItemName

@Length(min=1,
        max=50)
public java.lang.String getItemName()
Accessor for the itemName element. The accessor is preceded by Hibernate annotations, which define the validation for this property.

Returns:
The current value of the itemName.

setItemName

public void setItemName(java.lang.String itemName)
Mutator for the itemName element.

Parameters:
itemName - The new value to store in the itemName.

getDescription

public java.lang.String getDescription()
Accessor for the description element. The accessor is preceded by a Hibernate annotation, which defines the field as a Large Object.

Returns:
The current value of the description.

setDescription

public void setDescription(java.lang.String description)
Mutator for the description element.

Parameters:
description - The new value to store in the description.

getItemId

@NotNull
@Length(min=1,
        max=10)
public java.lang.String getItemId()
Accessor for the itemId element. The accessor is preceded by Hibernate annotations, which define the validation for this property.

Returns:
The current value of the itemId.

setItemId

public void setItemId(java.lang.String itemId)
Mutator for the itemId element.

Parameters:
itemId - The new value to store in the itemId.

getPrice

public double getPrice()
Accessor for the price element.

Returns:
The current value of the price.

setPrice

public void setPrice(double price)
Mutator for the price element.

Parameters:
price - The new value to store in the price.