DJDoc v.1.0.0b-1

net.sf.djdoc.bo
Class ItemHitEntity

java.lang.Object
  extended by net.sf.djdoc.bo.ItemHitEntity
All Implemented Interfaces:
BusinessObject

public class ItemHitEntity
extends java.lang.Object
implements BusinessObject

The ItemHitEntity is a persistence capable (via Hibernate) class. It implements a typical m-to-n-relationship between two other persistent classes (in this case, ItemEntity and UserEntity) with two additional attributes keeping track of the number of times and the last date the referenced user has accessed the referenced item.


Constructor Summary
ItemHitEntity()
           
 
Method Summary
static ItemHitEntity findByItemAndUser(ItemEntity item, UserEntity user)
          "Finder" method retrieving a particular ItemHitEntity from the database by the item and the user it references.
 int getHitCount()
          Getter method for this ItemHitEntity's hit count.
 java.util.Date getHitDate()
          Getter method for this ItemHitEntity's hit date.
 int getId()
          Getter method for this ItemHitEntity's internal ID.
 Item getItem()
          Getter method for the Item this ItemHitEntity references.
 User getUser()
          Getter method for the User this ItemHitEntity references.
static java.util.List<ItemHitEntity> selectByBunchAndUser(BunchEntity bunch, UserEntity user)
          "Selector" method retrieving all ItemHitEntity objects with a given BunchEntity and UserEntity from the database.
 void setHitCount(int hitCount)
          Setter method for this ItemHitEntity's hit count.
 void setHitDate(java.util.Date hitDate)
          Setter method for this ItemHitEntity's hit date.
 void setId(int id)
          Setter method for this ItemHitEntity's internal ID.
 void setItem(Item item)
          Setter method for the Item this ItemHitEntity references.
 void setUser(User user)
          Setter method for the User this ItemHitEntity references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemHitEntity

public ItemHitEntity()
Method Detail

selectByBunchAndUser

public static java.util.List<ItemHitEntity> selectByBunchAndUser(BunchEntity bunch,
                                                                 UserEntity user)
"Selector" method retrieving all ItemHitEntity objects with a given BunchEntity and UserEntity from the database.

Parameters:
bunch - The BunchEntity of the objects to be selected
user - The UserEntity of the objects to be selected
Returns:
A List of all ItemHitEntity objects with given BunchEntity and UserEntity

findByItemAndUser

public static ItemHitEntity findByItemAndUser(ItemEntity item,
                                              UserEntity user)
"Finder" method retrieving a particular ItemHitEntity from the database by the item and the user it references.

Parameters:
item - The ItemEntity referenced by the ItemHitEntity to be found
user - The UserEntity referenced by the ItemhHitEntity to be found
Returns:
The ItemHitEntity with the given item and user

getId

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

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

setId

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

Parameters:
id - The internal ID of this ItemHitEntity

getHitCount

public int getHitCount()
Getter method for this ItemHitEntity's hit count.

Returns:
The total number of times this object has been hit

setHitCount

public void setHitCount(int hitCount)
Setter method for this ItemHitEntity's hit count.

Parameters:
hitCount - The total number of times this object has been hit

getHitDate

public java.util.Date getHitDate()
Getter method for this ItemHitEntity's hit date.

Returns:
The date at which this object has been hit last

setHitDate

public void setHitDate(java.util.Date hitDate)
Setter method for this ItemHitEntity's hit date.

Parameters:
hitDate - The date at which this object has been hit last

getItem

public Item getItem()
Getter method for the Item this ItemHitEntity references.

Returns:
This ItemHitEntity's Item object

setItem

public void setItem(Item item)
Setter method for the Item this ItemHitEntity references.

Parameters:
item - This ItemHitEntity's Item object

getUser

public User getUser()
Getter method for the User this ItemHitEntity references.

Returns:
This ItemHitEntity's User object

setUser

public void setUser(User user)
Setter method for the User this ItemHitEntity references.

Parameters:
user - This ItemHitEntity's User object

DJDoc v.1.0.0b-1