2.17.2: 2011-06-17

net.sf.basedb.core.data
Interface NameableData

All Superinterfaces:
IdentifiableData
All Known Implementing Classes:
AnnotatedData, AnnotationTypeCategoryData, AnnotationTypeData, AnyToAnyData, ArrayBatchData, ArrayDesignData, ArraySlideData, BaseFileImporter.ReporterProxy, BioAssayData, BioAssaySetData, BioMaterialData, BioMaterialListData, BioPlateData, BioPlateEventData, BioPlateEventTypeData, BioPlateTypeData, BioSourceData, ClientData, CommonData, DataFileTypeData, DirectoryData, ExperimentData, ExtractData, ExtraValueTypeData, FileData, FileServerData, FileTypeData, FormulaData, GroupData, HardwareData, HardwareTypeData, HelpData, HybridizationData, ImageData, JobAgentData, JobData, LabelData, LabeledExtractData, MeasuredBioMaterialData, MessageData, MimeTypeData, NewsData, PermissionTemplateData, PlateData, PlateEventTypeData, PlateGeometryData, PlateMappingData, PlateTypeData, PlatformData, PlatformVariantData, PluginConfigurationData, PluginTypeData, ProjectData, ProtocolData, ProtocolTypeData, QuantityData, QuotaData, QuotaTypeData, RawBioAssayData, ReporterData, ReporterListData, ReporterTypeData, RoleData, SampleData, ScanData, SoftwareData, SoftwareTypeData, TransformationData, UnitData, UserData

public interface NameableData
extends IdentifiableData

A nameable item is an item that has a name and, optionally, a description.

This interface defines Hibernate database mappings for the name and description properties to database columns with the same name. If a subclass wants to map these properties to other columns, it should override the getName() and/or getDescription() methods and add a Hibernate tag in the comment.

Reference implementation

private String name;
public String getName()
{
   return name;
}
public void setName(String name)
{
   this.name = name;
}
private String description;
public String getDescription()
{
   return description;
}
public void setDescription(String description)
{
   this.description = description;
}

Version:
2.0
Author:
Nicklas
See Also:
CommonData, Basic classes and interfaces

Field Summary
static int MAX_DESCRIPTION_LENGTH
          The maximum length of the description of the item that can be stored in the database.
static int MAX_NAME_LENGTH
          The maximum length of the name of the item that can be stored in the database.
 
Method Summary
 String getDescription()
          Get the description for the item.
 String getName()
          Get the name of the item.
 void setDescription(String description)
          Set the description for the item.
 void setName(String name)
          Set the name of the item.
 
Methods inherited from interface net.sf.basedb.core.data.IdentifiableData
getId, getVersion
 

Field Detail

MAX_NAME_LENGTH

static final int MAX_NAME_LENGTH
The maximum length of the name of the item that can be stored in the database.

See Also:
setName(String), Constant Field Values

MAX_DESCRIPTION_LENGTH

static final int MAX_DESCRIPTION_LENGTH
The maximum length of the description of the item that can be stored in the database.

See Also:
setDescription(String), Constant Field Values
Method Detail

getName

String getName()
Get the name of the item.

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"

setName

void setName(String name)
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.

Parameters:
name - The new name for the item

getDescription

String getDescription()
Get the description for the item.

Returns:
A String with a description of the item
Hibernate: property
column="`description`" type="text" not-null="false"

setDescription

void setDescription(String description)
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.

Parameters:
description - The new description for the item

2.17.2: 2011-06-17