Package net.sf.basedb.core.data
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 Summary
Fields Modifier and Type Field Description 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 Integer
removedBy
private Date
timeSent
private UserData
to
-
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description MessageData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Integer
getRemovedBy()
Get the ID of the user that removed this 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.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
setRemovedBy(Integer removedBy)
Set the ID of the user that removed this item or null to restore the 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
-
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
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:NameableData
Get the name of the item.- Specified by:
getName
in interfaceNameableData
- 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 theMAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameableData
- 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 interfaceNameableData
- 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 theMAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameableData
- 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 interfaceRemovableData
- 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 interfaceRemovableData
-
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)
-
-