Class MessageData

java.lang.Object
net.sf.basedb.core.data.BasicData
net.sf.basedb.core.data.MessageData
All Implemented Interfaces:
IdentifiableData, NameableData, RemovableData

public class MessageData
extends BasicData
implements NameableData, RemovableData
This class holds information about messages.
Version:
2.0
Author:
Nicklas
See Also:
Message, Developer documentation: Other classes
Hibernate: class
table="`Messages`" lazy="false"
  • Field Details

    • name

      private String name
    • description

      private String description
    • removedBy

      private Integer removedBy
    • to

      private UserData to
    • MAX_FROM_LENGTH

      public static final int MAX_FROM_LENGTH
      The maximum length of the from property.
      See Also:
      getFrom(), Constant Field Values
    • from

      private String from
    • fromId

      private int fromId
    • timeSent

      private Date timeSent
    • job

      private JobData job
    • isRead

      private boolean isRead
  • Constructor Details

    • MessageData

      public MessageData()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: NameableData
      Get the name of the item.
      Specified by:
      getName in interface NameableData
      Returns:
      A String with the name of the item
    • setName

      public void setName​(String name)
      Description copied from interface: NameableData
      Set the name of the item. The name cannot be null and mustn't be longer than the value specified by the MAX_NAME_LENGTH constant.
      Specified by:
      setName in interface NameableData
      Parameters:
      name - The new name for the item
    • getDescription

      public String getDescription()
      Description copied from interface: NameableData
      Get the description for the item.
      Specified by:
      getDescription in interface NameableData
      Returns:
      A String with a description of the item
    • setDescription

      public void setDescription​(String description)
      Description copied from interface: NameableData
      Set the description for the item. The description can be null but mustn't be longer than the value specified by the MAX_DESCRIPTION_LENGTH constant.
      Specified by:
      setDescription in interface NameableData
      Parameters:
      description - The new description for the item
    • getRemovedBy

      public Integer getRemovedBy()
      Description copied from interface: RemovableData
      Get the ID of the user that removed this item.
      Specified by:
      getRemovedBy in interface RemovableData
      Returns:
      The ID of a user or null if the item is not removed
    • setRemovedBy

      public void setRemovedBy​(Integer removedBy)
      Description copied from interface: RemovableData
      Set the ID of the user that removed this item or null to restore the item.
      Specified by:
      setRemovedBy in interface RemovableData
    • getTo

      public UserData getTo()
      The user this message is to.
      Hibernate: many-to-one
      column="`to_user_id`" not-null="true" outer-join="false" update="false"
    • setTo

      public void setTo​(UserData to)
    • getFrom

      public String getFrom()
      The name of the user this message is from. It can also be another name such as 'SYSTEM'.
      Hibernate: property
      column="`from_name`" type="string" length="255" not-null="true" update="false"
    • setFrom

      public void setFrom​(String from)
    • getFromId

      public int getFromId()
      The id of the user if this message was from a real user. We map the id value only to avoid foreign key problems.
      Hibernate: property
      column="`from_user_id`" type="int" not-null="false" update="false"
    • setFromId

      public void setFromId​(int fromId)
    • getTimeSent

      public Date getTimeSent()
      Get the date and time this message was sent.
      Hibernate: property
      column="`time_sent`" type="timestamp" not-null="true" update="false"
    • setTimeSent

      public void setTimeSent​(Date timeSent)
    • getJob

      public JobData getJob()
      If this message is a message about a job completion (or failure) this property contains a reference to that job.
      Hibernate: many-to-one
      column="`job_id`" not-null="false" outer-join="false" update="false"
    • setJob

      public void setJob​(JobData job)
    • isRead

      public boolean isRead()
      Check if the message has been read or not.
      Hibernate: property
      column="`is_read`" type="boolean" not-null="true"
    • setRead

      public void setRead​(boolean isRead)