Package net.sf.basedb.core.data
Class RoleData
- java.lang.Object
-
- net.sf.basedb.core.data.BasicData
-
- net.sf.basedb.core.data.RoleData
-
- All Implemented Interfaces:
IdentifiableData
,NameableData
,RegisteredData
,RemovableData
,SystemData
public class RoleData extends BasicData implements NameableData, RemovableData, SystemData, RegisteredData
This class holds information about a role.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Role
, Developer documentation: User authentication- Last modified
- $Date: 2015-11-17 13:57:57 +0100 (ti, 17 nov 2015) $
- Hibernate: class
- table="`Roles`" lazy="false"
-
-
Field Summary
Fields Modifier and Type Field Description private String
description
private Date
entryDate
private boolean
isDefault
private Set<RoleKeyData>
keys
private String
name
private Integer
removedBy
private String
systemId
private Set<UserData>
users
-
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Fields inherited from interface net.sf.basedb.core.data.SystemData
MAX_SYSTEM_ID_LENGTH
-
-
Constructor Summary
Constructors Constructor Description RoleData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Get the description for the item.Date
getEntryDate()
Get the date this item was added to the database.(package private) Set<RoleKeyData>
getKeys()
This is the inverse end.String
getName()
Get the name of the item.Integer
getRemovedBy()
Get the ID of the user that removed this item.String
getSystemId()
Get the system id for the item.Set<UserData>
getUsers()
Get the set that manages which users are members of this role.boolean
isDefault()
If this role should be assigned to new users by default or not.void
setDefault(boolean isDefault)
void
setDescription(String description)
Set the description for the item.void
setEntryDate(Date entryDate)
(package private) void
setKeys(Set<RoleKeyData> keys)
void
setName(String name)
Set the name of the item.void
setRemovedBy(Integer removedBy)
Set the ID of the user that removed this item or null to restore the item.void
setSystemId(String systemId)
(package private) void
setUsers(Set<UserData> users)
-
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
-
-
-
-
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
-
getSystemId
public String getSystemId()
Description copied from interface:SystemData
Get the system id for the item.- Specified by:
getSystemId
in interfaceSystemData
- Returns:
- The id of the item or null
-
setSystemId
public void setSystemId(String systemId)
-
getEntryDate
public Date getEntryDate()
Description copied from interface:RegisteredData
Get the date this item was added to the database. The value is generated at creation time and can't be modified later.- Specified by:
getEntryDate
in interfaceRegisteredData
-
setEntryDate
public void setEntryDate(Date entryDate)
-
getUsers
public Set<UserData> getUsers()
Get the set that manages which users are members of this role.- Hibernate: set
- table="`UserRoles`" lazy="true"
- Hibernate: collection-key
- column="`role_id`"
- Hibernate: collection-many-to-many
- column="`user_id`" class="net.sf.basedb.core.data.UserData"
-
getKeys
Set<RoleKeyData> getKeys()
This is the inverse end.- See Also:
RoleKeyData.getRoles()
- Hibernate: set
- table="`RoleKeys`" lazy="true"
- Hibernate: collection-key
- column="`role_id`"
- Hibernate: collection-many-to-many
- column="`key_id`" class="net.sf.basedb.core.data.RoleKeyData"
-
setKeys
void setKeys(Set<RoleKeyData> keys)
-
isDefault
public boolean isDefault()
If this role should be assigned to new users by default or not.- Since:
- 2.4
- Hibernate: property
- column="`is_default`" type="boolean" not-null="true"
-
setDefault
public void setDefault(boolean isDefault)
-
-