com.atlassian.confluence.like
Class LikeEntity

java.lang.Object
  extended by com.atlassian.confluence.like.LikeEntity

public class LikeEntity
extends Object

Represents a like entity. Likes should be modelled as a value type, but hibernate only permits value types if they are stored in the same table as the entity type they belong to. In our use case we need a separate table for likes. The compromise is to model likes as an entity (so we get the separate table), but just ignore the database ID. This class should not be used outside the DAO. All client code should be interacting with the transfer object Like.


Constructor Summary
LikeEntity()
          For hibernate.
LikeEntity(long contentId, String username, Date creationDate)
           
 
Method Summary
 boolean equals(Object obj)
          Use business key of username and contentId pair (username and contentId is unique and is enforced by database unique constraint).
 long getContentId()
           
 Date getCreationDate()
           
 long getId()
           
 String getUsername()
           
 int hashCode()
           
 void setContentId(long contentId)
           
 void setCreationDate(Date creationDate)
           
 void setId(long id)
           
 void setUsername(String username)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LikeEntity

public LikeEntity()
For hibernate. Don't use.


LikeEntity

public LikeEntity(long contentId,
                  String username,
                  Date creationDate)
Method Detail

getContentId

public long getContentId()

getUsername

public String getUsername()

getCreationDate

public Date getCreationDate()

getId

public long getId()

setContentId

public void setContentId(long contentId)

setUsername

public void setUsername(String username)

setCreationDate

public void setCreationDate(Date creationDate)

setId

public void setId(long id)

equals

public boolean equals(Object obj)
Use business key of username and contentId pair (username and contentId is unique and is enforced by database unique constraint).

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2012 Atlassian. All Rights Reserved.