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 Details

  • Constructor Details

    • ItemSubtypeData

      public ItemSubtypeData()
  • Method Details

    • 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="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 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
    • getRemovedBy

      public Integer getRemovedBy()
      Description copied from interface: RemovableData
      Get the ID of the user that removed this item.
      Specified by:
      getRemovedBy in interface RemovableData
      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 interface RemovableData
    • 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="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. 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

      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

      void setFileTypes(Map<DataFileTypeData,ItemSubtypeFileTypeData> fileTypes)