Package net.sf.basedb.core.data
Class ProjectData
- java.lang.Object
-
- net.sf.basedb.core.data.BasicData
-
- net.sf.basedb.core.data.OwnedData
-
- net.sf.basedb.core.data.ProjectData
-
- All Implemented Interfaces:
AnnotatableData
,IdentifiableData
,LoggableData
,NameableData
,OwnableData
,RegisteredData
,RemovableData
public class ProjectData extends OwnedData implements NameableData, RemovableData, RegisteredData, AnnotatableData, LoggableData
This class holds information about a project.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Project
, Developer documentation: User authentication- Last modified
- $Date: 2016-10-17 10:38:36 +0200 (må, 17 okt 2016) $
- Hibernate: class
- table="`Projects`" lazy="false"
-
-
Field Summary
Fields Modifier and Type Field Description private AnnotationSetData
annotationSet
private int
autoPermission
private ItemParameterValueData
defaultItems
private String
description
private Date
entryDate
private Map<GroupData,Integer>
groups
private Set<AnnotationLink>
links
private String
name
private PermissionTemplateData
permissionTemplate
private Map<String,String>
projectDefaults
private Set<ProjectKeyData>
projectKeys
private Integer
removedBy
private Map<UserData,Integer>
users
-
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ProjectData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<AnnotationLink>
getAnnotations()
Short-cut to all annotations belonging to this item.AnnotationSetData
getAnnotationSet()
Get the annotation set that holds the annotations for an item.int
getAutoPermission()
The permissions to use with automatic sharing to this project.ItemParameterValueData
getDefaultItems()
The default items to use in this projectString
getDescription()
Get the description for the item.Date
getEntryDate()
Get the date this item was added to the database.Map<GroupData,Integer>
getGroups()
Get the map that manages which users are members of this project and their permissions.String
getName()
Get the name of the item.PermissionTemplateData
getPermissionTemplate()
A permission template can be used to set default permissions when this project is active.Map<String,String>
getProjectDefaults()
Gets the default values(package private) Set<ProjectKeyData>
getProjectKeys()
This is the inverse end.Integer
getRemovedBy()
Get the ID of the user that removed this item.Map<UserData,Integer>
getUsers()
Get the map that manages which users are members of this project and their permissions.(package private) void
setAnnotations(Set<AnnotationLink> links)
void
setAnnotationSet(AnnotationSetData annotationSet)
Change the annotation set.void
setAutoPermission(int autoPermission)
void
setDefaultItems(ItemParameterValueData defaultItems)
void
setDescription(String description)
Set the description for the item.void
setEntryDate(Date entryDate)
(package private) void
setGroups(Map<GroupData,Integer> groups)
void
setName(String name)
Set the name of the item.void
setPermissionTemplate(PermissionTemplateData permissionTemplate)
(package private) void
setProjectDefaults(Map<String,String> projectDefaults)
(package private) void
setProjectKeys(Set<ProjectKeyData> projectKeys)
void
setRemovedBy(Integer removedBy)
Set the ID of the user that removed this item or null to restore the item.(package private) void
setUsers(Map<UserData,Integer> 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
-
-
-
-
Field Detail
-
name
private String name
-
description
private String description
-
removedBy
private Integer removedBy
-
entryDate
private Date entryDate
-
annotationSet
private AnnotationSetData annotationSet
-
links
private Set<AnnotationLink> links
-
autoPermission
private int autoPermission
-
permissionTemplate
private PermissionTemplateData permissionTemplate
-
projectKeys
private Set<ProjectKeyData> projectKeys
-
defaultItems
private ItemParameterValueData defaultItems
-
-
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
-
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)
-
getAnnotationSet
public AnnotationSetData getAnnotationSet()
Description copied from interface:AnnotatableData
Get the annotation set that holds the annotations for an item.- Specified by:
getAnnotationSet
in interfaceAnnotatableData
- Returns:
- An
AnnotationSetData
item or null if no annotations exist - Since:
- 3.10
-
setAnnotationSet
public void setAnnotationSet(AnnotationSetData annotationSet)
Description copied from interface:AnnotatableData
Change the annotation set. Use null to remove the annotations.- Specified by:
setAnnotationSet
in interfaceAnnotatableData
- Parameters:
annotationSet
- Annotation set to change to.- Since:
- 3.10
-
getAnnotations
public Set<AnnotationLink> getAnnotations()
Description copied from interface:AnnotatableData
Short-cut to all annotations belonging to this item. Used for HQL queries only. This is the inverse end. NOTE! The property-ref="annotationSet" require that AnnotationSetData implements Serializable- Specified by:
getAnnotations
in interfaceAnnotatableData
- Since:
- 3.10
-
setAnnotations
void setAnnotations(Set<AnnotationLink> links)
-
getAutoPermission
public int getAutoPermission()
The permissions to use with automatic sharing to this project.- Since:
- 2.10
- Hibernate: property
- column="`auto_permission`" type="int" not-null="true"
-
setAutoPermission
public void setAutoPermission(int autoPermission)
-
getPermissionTemplate
public PermissionTemplateData getPermissionTemplate()
A permission template can be used to set default permissions when this project is active.- Returns:
- A permission template or null
- Since:
- 2.16
- Hibernate: many-to-one
- column="`permissiontemplate_id`" not-null="false"
-
setPermissionTemplate
public void setPermissionTemplate(PermissionTemplateData permissionTemplate)
-
getUsers
public Map<UserData,Integer> getUsers()
Get the map that manages which users are members of this project and their permissions.- Hibernate: map
- table="`UserProjects`" lazy="true"
- Hibernate: index-many-to-many
- column="`user_id`" class="net.sf.basedb.core.data.UserData"
- Hibernate: collection-key
- column="`project_id`"
- Hibernate: collection-element
- column="`permission`" type="int" not-null="true"
-
getGroups
public Map<GroupData,Integer> getGroups()
Get the map that manages which users are members of this project and their permissions.- Hibernate: map
- table="`GroupProjects`" lazy="true"
- Hibernate: index-many-to-many
- column="`group_id`" class="net.sf.basedb.core.data.GroupData"
- Hibernate: collection-key
- column="`project_id`"
- Hibernate: collection-element
- column="`permission`" type="int" not-null="true"
-
getProjectKeys
Set<ProjectKeyData> getProjectKeys()
This is the inverse end.- See Also:
ProjectKeyData.getProjects()
- Hibernate: set
- table="`ProjectKeys`" lazy="true"
- Hibernate: collection-key
- column="`project_id`"
- Hibernate: collection-many-to-many
- column="`key_id`" class="net.sf.basedb.core.data.ProjectKeyData"
-
setProjectKeys
void setProjectKeys(Set<ProjectKeyData> projectKeys)
-
getProjectDefaults
public Map<String,String> getProjectDefaults()
Gets the default values- Hibernate: map
- table="`ProjectDefaults`" lazy="true"
- Hibernate: collection-key
- column="`project_id`"
- Hibernate: collection-index
- column="`name`" type="string" length="255" not-null="true"
- Hibernate: collection-element
- column="`value`" type="string" length="255" not-null="true"
-
getDefaultItems
public ItemParameterValueData getDefaultItems()
The default items to use in this project- Hibernate: many-to-one
- column="`defaultitems_id`" not-null="false" cascade="all" unique="true"
-
setDefaultItems
public void setDefaultItems(ItemParameterValueData defaultItems)
-
-