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 the
SubtypableData
interface. For a given item type the name
of the subtype should be unique.- Since:
- 3.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2015-11-17 13:57:57 +0100 (ti, 17 nov 2015) $
- Hibernate: class
- table="`ItemSubtypes`" lazy="false"
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private Date
private Map<DataFileTypeData,
ItemSubtypeFileTypeData> private int
private String
private Set<ItemSubtypeData>
private boolean
private Map<Integer,
ItemSubtypeData> private Integer
private String
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
-
Method Summary
Modifier and TypeMethodDescriptionGet the description for the item.Get the date this item was added to the database.The file types that can be used on items of this subtype.int
Get the item type this subtype can be applied to.getName()
Get the name of the subtype which must be unique for subtypes related to a given item type.(package private) Set<ItemSubtypeData>
This is the inverse end.boolean
If this flag is set, the annotations on items of this subtype should be enabled for pushing to the parent item.Get the ID of the user that removed this item.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
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 Details
-
name
-
description
-
removedBy
-
entryDate
-
systemId
-
itemType
private int itemType -
pushAnnotations
private boolean pushAnnotations -
parents
-
fileTypes
-
-
Constructor Details
-
ItemSubtypeData
public ItemSubtypeData()
-
-
Method Details
-
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
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
-
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
-
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
-
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
- 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
-
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
-
getFileTypes
The file types that can be used on items of this subtype. This is the inverse end.- See Also:
- 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
-