DJDoc v.1.0.0b-1

net.sf.djdoc.bo
Class ItemEntity

java.lang.Object
  extended by net.sf.djdoc.bo.ItemVO
      extended by net.sf.djdoc.bo.ItemEntity
All Implemented Interfaces:
java.lang.Comparable, BusinessObject, Hittable, Item

public class ItemEntity
extends ItemVO
implements BusinessObject

The ItemEntity is a persistence capable (via Hibernate) class. In addition to the "basic" properties of the ItemVO class it extends, it has a collection valued persistent property of all the item's hits and an object valued property of the Bunch (the package) the item belongs to.
The ItemEntity's item type is mapped to the database via its ordinal, so the itemType property is itself declared as transient.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.djdoc.bo.Item
Item.ItemType
 
Field Summary
 
Fields inherited from interface net.sf.djdoc.bo.Hittable
FAVORITE, NATURAL, RECENT
 
Constructor Summary
ItemEntity()
           
 
Method Summary
static ItemEntity findByBunchAndName(BunchEntity bunch, java.lang.String itemName)
          "Finder" method for retrieving an ItemEntity object from the database by the BunchEntity it belongs to and its item name.
 Bunch getBunch()
          Getter method for this ItemEntity's package object.
 int getId()
          Getter method for this ItemEntity's internal ID.
 java.util.Set<ItemHitEntity> getItemHits()
          Getter method for the set of ItemHitEntity objects of this ItemEntity.
 int getTypeId()
          Getter method for this ItemEntity's item type ID.
 void setBunch(Bunch bunch)
          Setter method for this ItemEntity's package object.
 void setId(int id)
          Setter method for this ItemEntity's internal ID.
 void setItemHits(java.util.Set<ItemHitEntity> itemHits)
          Setter method for the set of ItemHitEntity objects of this ItemEntity.
 void setType(Item.ItemType type)
          Setter method for this ItemEntity's item type.
 void setTypeId(int typeId)
          Setter method for this ItemEntity's item type ID.
 
Methods inherited from class net.sf.djdoc.bo.ItemVO
compareTo, getHitCount, getHitDate, getName, getType, hit, setHitCount, setHitDate, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemEntity

public ItemEntity()
Method Detail

findByBunchAndName

public static ItemEntity findByBunchAndName(BunchEntity bunch,
                                            java.lang.String itemName)
"Finder" method for retrieving an ItemEntity object from the database by the BunchEntity it belongs to and its item name.

Parameters:
bunch - The BunchEntity the retrieved ItemEntity belongs to
itemName - The item name of the retrieved ItemEntity
Returns:
The ItemEntity with the specified package and name

getId

public int getId()
Getter method for this ItemEntity's internal ID.

Specified by:
getId in interface BusinessObject
Returns:
The internal ID of this ItemEntity

setId

public void setId(int id)
Setter method for this ItemEntity's internal ID.

Parameters:
id - The internal ID of this ItemEntity

setType

public void setType(Item.ItemType type)
Setter method for this ItemEntity's item type.

Overrides:
setType in class ItemVO
Parameters:
type - The item type of this ItemEntity

getTypeId

public int getTypeId()
Getter method for this ItemEntity's item type ID. This is the ordinal of the ItemEntity's ItemType member in the ItemType enum.

Returns:
The item type ID of this ItemEntity

setTypeId

public void setTypeId(int typeId)
Setter method for this ItemEntity's item type ID. This is the ordinal of the ItemEntity's ItemType member in the ItemType enum.

Parameters:
typeId - The item type ID of this ItemEntity

getBunch

public Bunch getBunch()
Getter method for this ItemEntity's package object.

Returns:
The package object of this ItemEntity

setBunch

public void setBunch(Bunch bunch)
Setter method for this ItemEntity's package object.

Parameters:
bunch - The package object of this ItemEntity

getItemHits

public java.util.Set<ItemHitEntity> getItemHits()
Getter method for the set of ItemHitEntity objects of this ItemEntity.

Returns:
This ItemEntity's ItemHitEntity set

setItemHits

public void setItemHits(java.util.Set<ItemHitEntity> itemHits)
Setter method for the set of ItemHitEntity objects of this ItemEntity.

Parameters:
itemHits - This ItemEntity's ItemHitEntity set

DJDoc v.1.0.0b-1