Package net.sf.basedb.core.data
Class ItemSubtypeData
- java.lang.Object
-
- net.sf.basedb.core.data.BasicData
-
- net.sf.basedb.core.data.ItemSubtypeData
-
- All Implemented Interfaces:
IdentifiableData
,NameableData
,RegisteredData
,RemovableData
,SystemData
public class ItemSubtypeData extends BasicData implements NameableData, RemovableData, RegisteredData, SystemData
Item subtypes can be used to classify items into sub-categories. Subtypes can be defined for all item types that implement theSubtypableData
interface. For a given item type the name of the subtype should be unique.- Since:
- 3.0
- Author:
- Nicklas
- See Also:
- Developer documentation: Experimental platforms and item subtypes
- Last modified
- $Date: 2015-11-17 13:57:57 +0100 (ti, 17 nov 2015) $
- Hibernate: class
- table="`ItemSubtypes`" lazy="false"
-
-
Field Summary
Fields Modifier and Type Field Description private String
description
private Date
entryDate
private Map<DataFileTypeData,ItemSubtypeFileTypeData>
fileTypes
private int
itemType
private String
name
private Set<ItemSubtypeData>
parents
private boolean
pushAnnotations
private Map<Integer,ItemSubtypeData>
relatedSubtypes
private Integer
removedBy
private String
systemId
-
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 ItemSubtypeData()
-
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.Map<DataFileTypeData,ItemSubtypeFileTypeData>
getFileTypes()
The file types that can be used on items of this subtype.int
getItemType()
Get the item type this subtype can be applied to.String
getName()
Get the name of the subtype which must be unique for subtypes related to a given item type.(package private) Set<ItemSubtypeData>
getParents()
This is the inverse end.boolean
getPushAnnotations()
If this flag is set, the annotations on items of this subtype should be enabled for pushing to the parent item.Map<Integer,ItemSubtypeData>
getRelatedSubtypes()
Integer
getRemovedBy()
Get the ID of the user that removed this item.String
getSystemId()
Override the property definition since we may have to update the system id during installation.void
setDescription(String description)
Set the description for the item.void
setEntryDate(Date entryDate)
(package private) void
setFileTypes(Map<DataFileTypeData,ItemSubtypeFileTypeData> fileTypes)
void
setItemType(int itemType)
void
setName(String name)
Set the name of the item.(package private) void
setParents(Set<ItemSubtypeData> parents)
void
setPushAnnotations(boolean pushAnnotations)
(package private) void
setRelatedSubtypes(Map<Integer,ItemSubtypeData> relatedSubtypes)
void
setRemovedBy(Integer removedBy)
Set the ID of the user that removed this item or null to restore the item.void
setSystemId(String systemId)
-
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
-
systemId
private String systemId
-
itemType
private int itemType
-
pushAnnotations
private boolean pushAnnotations
-
relatedSubtypes
private Map<Integer,ItemSubtypeData> relatedSubtypes
-
parents
private Set<ItemSubtypeData> parents
-
fileTypes
private Map<DataFileTypeData,ItemSubtypeFileTypeData> fileTypes
-
-
Method Detail
-
getName
public String getName()
Get the name of the subtype which must be unique for subtypes related to a given item type.- Specified by:
getName
in interfaceNameableData
- Returns:
- A
String
with the name of the item - Hibernate: property
- type="string"
- Hibernate: column
- name="`name`" length="255" not-null="true" index="name_idx" unique-key="ItemSubtype_uniquesubtype"
-
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)
-
getSystemId
public String getSystemId()
Override the property definition since we may have to update the system id during installation.- Specified by:
getSystemId
in interfaceSystemData
- Returns:
- The id of the item or null
- Hibernate: property
- column="`system_id`" type="string" length="255" not-null="false" update="true"
-
setSystemId
public void setSystemId(String systemId)
-
getItemType
public int getItemType()
Get the item type this subtype can be applied to. Can't be modified after the subtype has been created.- Hibernate: property
- update="false"
- Hibernate: column
- name="`item_type`" type="int" not-null="true" unique-key="ItemSubtype_uniquesubtype"
-
setItemType
public void setItemType(int itemType)
-
getPushAnnotations
public boolean getPushAnnotations()
If this flag is set, the annotations on items of this subtype should be enabled for pushing to the parent item. NOTE! This property is mapped in hibernate-properties-ItemSubtypeData.xml since 'default' is not supported by XDoclet //hibernate.property type="boolean" //hibernate.column name="`push_annotations`" not-null="true" default="false"- Since:
- 3.1
-
setPushAnnotations
public void setPushAnnotations(boolean pushAnnotations)
-
getRelatedSubtypes
public Map<Integer,ItemSubtypeData> getRelatedSubtypes()
- Hibernate: map
- table="`RelatedSubtypes`" lazy="true"
- Hibernate: collection-key
- column="`itemsubtype_id`"
- Hibernate: collection-index
- column="`item_type`" type="int" not-null="true"
- Hibernate: collection-many-to-many
- column="`related_subtype_id`" class="net.sf.basedb.core.data.ItemSubtypeData"
-
setRelatedSubtypes
void setRelatedSubtypes(Map<Integer,ItemSubtypeData> relatedSubtypes)
-
getParents
Set<ItemSubtypeData> getParents()
This is the inverse end. SeegetRelatedSubtypes()
.- Hibernate: set
- table="`RelatedSubtypes`" lazy="true"
- Hibernate: collection-key
- column="`related_subtype_id`"
- Hibernate: collection-many-to-many
- column="`itemsubtype_id`" class="net.sf.basedb.core.data.ItemSubtypeData"
-
setParents
void setParents(Set<ItemSubtypeData> parents)
-
getFileTypes
public Map<DataFileTypeData,ItemSubtypeFileTypeData> getFileTypes()
The file types that can be used on items of this subtype. This is the inverse end.- See Also:
ItemSubtypeFileTypeData.getItemSubtype()
- Hibernate: map
- lazy="true" cascade="delete" inverse="true"
- Hibernate: index-many-to-many
- column="`datafiletype_id`" class="net.sf.basedb.core.data.DataFileTypeData"
- Hibernate: collection-key
- column="`subtype_id`"
- Hibernate: collection-one-to-many
- class="net.sf.basedb.core.data.ItemSubtypeFileTypeData"
-
setFileTypes
void setFileTypes(Map<DataFileTypeData,ItemSubtypeFileTypeData> fileTypes)
-
-