3.2.1: 2012-12-13

net.sf.basedb.core.data
Class ItemSubtypeData

java.lang.Object
  extended by net.sf.basedb.core.data.BasicData
      extended by 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:
Developer documentation: Experimental platforms and item subtypes
Last modified
$Date: 2012-09-27 14:37:53 +0200 (Thu, 27 Sep 2012) $
Hibernate: class
table="`ItemSubtypes`" lazy="false"

Field Summary
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  boolean removed
           
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
ItemSubtypeData()
           
 
Method Summary
 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()
           
 String getSystemId()
          Override the property definition since we may have to update the system id during installation.
 boolean isRemoved()
          Check if the removed flag is set for this item.
 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 setRemoved(boolean removed)
          Set the removed flag for this 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

removed

private boolean removed

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
Constructor Detail

ItemSubtypeData

public ItemSubtypeData()
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 interface NameableData
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="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 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)

getSystemId

public String getSystemId()
Override the property definition since we may have to update the system id during installation.

Specified by:
getSystemId in interface SystemData
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="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. See getRelatedSubtypes().

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)

3.2.1: 2012-12-13