2.17.2: 2011-06-17

net.sf.basedb.core.data
Class MessageData

java.lang.Object
  extended by net.sf.basedb.core.data.BasicData
      extended by 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, Data API - Other classes
Hibernate: class
table="`Messages`" lazy="false"

Field Summary
private  String description
           
private  String from
           
private  int fromId
           
private  boolean isRead
           
private  JobData job
           
static int MAX_FROM_LENGTH
          The maximum length of the from property.
private  String name
           
private  boolean removed
           
private  Date timeSent
           
private  UserData to
           
 
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
MessageData()
           
 
Method Summary
 String getDescription()
          Get the description for the item.
 String getFrom()
          The name of the user this message is from.
 int getFromId()
          The id of the user if this message was from a real user.
 JobData getJob()
          If this message is a message about a job completion (or failure) this property contains a reference to that job.
 String getName()
          Get the name of the item.
 Date getTimeSent()
          Get the date and time this message was sent.
 UserData getTo()
          The user this message is to.
 boolean isRead()
          Check if the message has been read or not.
 boolean isRemoved()
          Check if the removed flag is set for this item.
 void setDescription(String description)
          Set the description for the item.
 void setFrom(String from)
           
 void setFromId(int fromId)
           
 void setJob(JobData job)
           
 void setName(String name)
          Set the name of the item.
 void setRead(boolean isRead)
           
 void setRemoved(boolean removed)
          Set the removed flag for this item.
 void setTimeSent(Date timeSent)
           
 void setTo(UserData to)
           
 
Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.data.IdentifiableData
getId, getVersion
 

Field Detail

name

private String name

description

private String description

removed

private boolean removed

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 Detail

MessageData

public MessageData()
Method Detail

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

isRemoved

public boolean isRemoved()
Description copied from interface: RemovableData
Check if the removed flag is set for this item.

Specified by:
isRemoved in interface RemovableData
Returns:
TRUE if the item is flagged as removed, FALSE otherwise

setRemoved

public void setRemoved(boolean removed)
Description copied from interface: RemovableData
Set the removed flag for this item.

Specified by:
setRemoved in interface RemovableData
Parameters:
removed - TRUE if the item should be flagged as removed, FALSE otherwise

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)

2.17.2: 2011-06-17