2.17.2: 2011-06-17

net.sf.basedb.core.data
Class ProjectData

java.lang.Object
  extended by net.sf.basedb.core.data.BasicData
      extended by net.sf.basedb.core.data.OwnedData
          extended by net.sf.basedb.core.data.ProjectData
All Implemented Interfaces:
IdentifiableData, NameableData, OwnableData, RegisteredData, RemovableData

public class ProjectData
extends OwnedData
implements NameableData, RemovableData, RegisteredData

This class holds information about a project.

Version:
2.0
Author:
Nicklas
See Also:
Project, Authentication overview
Last modified
$Date: 2010-06-22 14:51:41 +0200 (Tue, 22 Jun 2010) $
Hibernate: class
table="`Projects`" lazy="false"

Field Summary
private  int autoPermission
           
private  String description
           
private  Date entryDate
           
private  Map<GroupData,Integer> groups
           
private  String name
           
private  PermissionTemplateData permissionTemplate
           
private  Map<String,String> projectDefaults
           
private  Set<ProjectKeyData> projectKeys
           
private  boolean removed
           
private  Map<UserData,Integer> users
           
 
Fields inherited from interface net.sf.basedb.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
ProjectData()
           
 
Method Summary
 int getAutoPermission()
          The permissions to use with automatic sharing to this project.
 String 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.
 Map<UserData,Integer> getUsers()
          Get the map that manages which users are members of this project and their permissions.
 boolean isRemoved()
          Check if the removed flag is set for this item.
 void setAutoPermission(int autoPermission)
           
 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 setRemoved(boolean removed)
          Set the removed flag for this item.
(package private)  void setUsers(Map<UserData,Integer> users)
           
 
Methods inherited from class net.sf.basedb.core.data.OwnedData
getOwner, setOwner
 
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

entryDate

private Date entryDate

autoPermission

private int autoPermission

permissionTemplate

private PermissionTemplateData permissionTemplate

users

private Map<UserData,Integer> users

groups

private Map<GroupData,Integer> groups

projectKeys

private Set<ProjectKeyData> projectKeys

projectDefaults

private Map<String,String> projectDefaults
Constructor Detail

ProjectData

public ProjectData()
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

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 interface RegisteredData

setEntryDate

public void setEntryDate(Date entryDate)

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"

setUsers

void setUsers(Map<UserData,Integer> users)

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"

setGroups

void setGroups(Map<GroupData,Integer> groups)

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"

setProjectDefaults

void setProjectDefaults(Map<String,String> projectDefaults)

2.17.2: 2011-06-17