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
This class holds information about messages.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Hibernate: class
- table="`Messages`" lazy="false"
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private String
private int
private boolean
private JobData
static final int
The maximum length of the from property.private String
private Integer
private Date
private UserData
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the description for the item.getFrom()
The name of the user this message is from.int
The id of the user if this message was from a real user.getJob()
If this message is a message about a job completion (or failure) this property contains a reference to that job.getName()
Get the name of the item.Get the ID of the user that removed this item.Get the date and time this message was sent.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
void
setFromId
(int fromId) void
void
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
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 Details
-
name
-
description
-
removedBy
-
to
-
MAX_FROM_LENGTH
public static final int MAX_FROM_LENGTHThe maximum length of the from property.- See Also:
-
from
-
fromId
private int fromId -
timeSent
-
job
-
isRead
private boolean isRead
-
-
Constructor Details
-
MessageData
public MessageData()
-
-
Method Details
-
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
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
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
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
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
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
The user this message is to.- Hibernate: many-to-one
- column="`to_user_id`" not-null="true" outer-join="false" update="false"
-
setTo
-
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
-
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
Get the date and time this message was sent.- Hibernate: property
- column="`time_sent`" type="timestamp" not-null="true" update="false"
-
setTimeSent
-
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
-
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)
-