2.17.2: 2011-06-17

net.sf.basedb.core.data
Interface IdentifiableData

All Known Subinterfaces:
AnnotatableData, BatchableData, DiskConsumableData, ExtendableData, FileAttachableData, FileStoreEnabledData, NameableData, OwnableData, RegisteredData, RemovableData, ShareableData, SystemData
All Known Implementing Classes:
AnnotatedData, AnnotationData, AnnotationSetData, AnnotationTypeCategoryData, AnnotationTypeData, AnyToAnyData, ArrayBatchData, ArrayDesignBlockData, ArrayDesignData, ArrayDesignPlateData, ArraySlideData, BaseFileImporter.RawDataProxy, BaseFileImporter.ReporterProxy, BasicData, BioAssayData, BioAssaySetData, BioMaterialData, BioMaterialEventData, BioMaterialListData, BioPlateData, BioPlateEventData, BioPlateEventParticipantData, BioPlateEventTypeData, BioPlateTypeData, BioSourceData, BioWellData, BooleanParameterValueData, ChangeHistoryData, ChangeHistoryDetailData, ClientData, ClientDefaultSettingData, CommonData, ContextData, DataCubeColumnData, DataCubeData, DataCubeExtraValueData, DataCubeFilterData, DataCubeLayerData, DataFileTypeData, DateParameterValueData, DirectoryData, DiskUsageData, DoubleParameterValueData, ExperimentData, ExtractData, ExtraValueData, ExtraValueTypeData, FeatureData, FileData, FileServerData, FileSetData, FileSetMemberData, FileTypeData, FloatParameterValueData, FormulaData, GlobalDefaultSettingData, GroupData, HardwareData, HardwareTypeData, HelpData, HybridizationData, ImageData, IntegerParameterValueData, ItemKeyData, ItemParameterValueData, JobAgentData, JobAgentSettingsData, JobData, KeyData, LabelData, LabeledExtractData, LongParameterValueData, MeasuredBioMaterialData, MessageData, MimeTypeData, NewsData, OwnedData, ParameterValueData, PasswordData, PermissionTemplateData, PlateData, PlateEventData, PlateEventTypeData, PlateGeometryData, PlateMappingData, PlateTypeData, PlatformData, PlatformFileTypeData, PlatformVariantData, PluginConfigurationData, PluginDefinitionData, PluginTypeData, ProjectData, ProjectKeyData, ProtocolData, ProtocolTypeData, QuantityData, QuotaData, QuotaTypeData, RawBioAssayData, RawData, ReporterData, ReporterListData, ReporterTypeData, RoleData, RoleKeyData, SampleData, ScanData, SchemaVersionData, SessionData, SettingData, SharedData, SoftwareData, SoftwareTypeData, SpotImagesData, StringParameterValueData, TextParameterValueData, TimestampParameterValueData, TransformationData, UnitData, UnitSymbolData, UserClientSettingData, UserData, UserDefaultSettingData, VirtualDbData, WellData

public interface IdentifiableData

An identifiable item is an item which has an id and a version. The id is always greater than 0 for an item which has been saved to the database, and 0 for a new item that has not yet been saved to the database.

The version number is used by Hibernate to prevent concurrent modifications by different threads or processes. It does this by incrementing the version number each time the information is updated in the database. If the version number in the database is different from the version on the object it is interpreted as another process has modified the item and an exception is thrown.

This interface is implemented by the BasicData class, which also provides the Hibernate mapping for the id property.

Hibernate also requires a setId() and a setVersion() method, so this must also be implemented even though it is not required by this interface.

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

Method Summary
 int getId()
          Get the id for the item.
 int getVersion()
          Get the version of this item.
 

Method Detail

getId

int getId()
Get the id for the item. If it hasn't yet been saved to the database 0 is returned.

Returns:
The id of the item or 0

getVersion

int getVersion()
Get the version of this item. The version starts at 0, and is increased each time the information is updated. The version number is controlled by Hibernate.


2.17.2: 2011-06-17