com.atlassian.confluence.like
Class LikeEntity

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

public class LikeEntity
extends java.lang.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(ContentEntityObject content, ConfluenceUser user, java.util.Date creationDate)
           
LikeEntity(ContentEntityObject content, java.lang.String username, java.util.Date creationDate)
          Deprecated. 
LikeEntity(long contentId, java.lang.String username, java.util.Date creationDate)
          Deprecated. 
 
Method Summary
 boolean equals(java.lang.Object obj)
          Use business key of username and contentId pair (username and contentId is unique and is enforced by database unique constraint).
 ContentEntityObject getContent()
           
 long getContentId()
          Deprecated. since 4.3.4 use getContent
 java.util.Date getCreationDate()
           
 long getId()
           
 ConfluenceUser getUser()
           
 java.lang.String getUsername()
          Deprecated. since 5.2. Use getUser() instead.
 int hashCode()
           
 void setContent(ContentEntityObject content)
           
 void setContentId(long contentId)
          Deprecated. since 4.3.4 use setContent
 void setCreationDate(java.util.Date creationDate)
           
 void setId(long id)
           
 void setUser(ConfluenceUser user)
           
 void setUsername(java.lang.String username)
          Deprecated. since 5.2. Use setUser(com.atlassian.confluence.user.ConfluenceUser) instead.
 
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

@Deprecated
public LikeEntity(long contentId,
                             java.lang.String username,
                             java.util.Date creationDate)
Deprecated. 


LikeEntity

@Deprecated
public LikeEntity(ContentEntityObject content,
                             java.lang.String username,
                             java.util.Date creationDate)
Deprecated. 

Since:
5.2. Use LikeEntity(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.confluence.user.ConfluenceUser, java.util.Date) instead.

LikeEntity

public LikeEntity(ContentEntityObject content,
                  ConfluenceUser user,
                  java.util.Date creationDate)
Since:
5.2
Method Detail

getContent

public ContentEntityObject getContent()

getUser

public ConfluenceUser getUser()
Since:
5.2

getUsername

@Deprecated
public java.lang.String getUsername()
Deprecated. since 5.2. Use getUser() instead.


getCreationDate

public java.util.Date getCreationDate()

getId

public long getId()

setContent

public void setContent(ContentEntityObject content)

setContentId

@Deprecated
public void setContentId(long contentId)
Deprecated. since 4.3.4 use setContent


getContentId

@Deprecated
public long getContentId()
Deprecated. since 4.3.4 use getContent

Returns:

setUser

public void setUser(ConfluenceUser user)
Since:
5.2

setUsername

@Deprecated
public void setUsername(java.lang.String username)
Deprecated. since 5.2. Use setUser(com.atlassian.confluence.user.ConfluenceUser) instead.


setCreationDate

public void setCreationDate(java.util.Date creationDate)

setId

public void setId(long id)

equals

public boolean equals(java.lang.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 java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2003-2013 Atlassian. All Rights Reserved.