This document contains information about the basic classes and interfaces in this package.
They are important since all data-layer classes must inherit from one of the already
existing abstract base classes or implement one or more of the
existing interfaces. They contain code that is common to all classes,
for example implementations of the equals()
and hashCode()
methods or how to link with the owner of an
item.
BasicData
The root class. It overrides the equals()
,
hashCode()
and toString()
methods
from the Object
class. It also defines the
id
and version
properties.
All data layer classes must inherit from this class or one of it's subclasses.
OwnedData
Extends the BasicData
class and adds
an owner
property. The owner is a required link to a
UserData
SharedData
Extends the OwnedData
class and adds
properties (itemKey
and projectKey
)
that holds access permission information for an item.
Access permissions are held in ItemKeyData
ProjectKeyData
CommonData
This is a convenience class for items that extends the SharedData
class and implements the NameableData
RemoveableData
AnnotatedData
This is a convenience class for items that can be annotated.
Annotations are held in AnnotationSetData
IdentifiableData
All items are identifiable, which means that they have a unique id
.
The id is unique for all items of a specific type (ie. class). The id is number
that is automatically generated by the database and has no other meaning
outside of the application. The version
property is used for
detecting and preventing concurrent modifications to an item.
OwnableData
An ownable item is an item which has an owner. The owner is represented as a
required link to a UserData
ShareableData
A shareable item is an item which can be shared to other users, groups or projects.
Access permissions are held in ItemKeyData
ProjectKeyData
NameableData
A nameable item is an item that has a name (required) and a description (optional). The name doesn't have to be unique, except in a few special cases (for example, the name of a file).
RemovableData
A removable item is an item that can be flagged as removed. This doesn't remove the information about the item from the database, but can be used by client applications to hide items that the user is not interested in. A trashcan function can be used to either restore or permanently remove items that has the flag set.
SystemData
A system item is an item which has an additional id in the form of string. A system id
is required when we need to make sure that we can get a specific item without
knowing the numeric id. Example of such items are the root user and the everyone group.
A system id is generally constructed like:
net.sf.basedb.core.User.ROOT
. The system id:s are defined in the
core layer by each item class.
DiskConsumableData
This interface is used by items which occupies a lot of disk space and
should be part of the quota system, for example files. The required
DiskUsageData
AnnotatableData
This interface is used by items which can be annotated. Annotations are name/value
pairs that are attached as extra information to an item. All annotations are
contained in an AnnotationSetData
ExtendableData
This interface is used by items which can have extra administrator-defined columns. The functionality is similar to annotations. It is not as flexible, since it is a global configuration, but has better performance. BASE will generate extra database columns to store the data in the tables for items that can be extended.
BatchableData
This interface is a tagging interface which is used by items that needs batch functionality in the core.
RegisteredData
This interface is used by items which registered the date they were
created in the database. The registration date is set at creation time
and can't be modified later. Since this didn't exist prior to BASE 2.10,
null values are allowed on all pre-existing items. Note! For backwards
compatibility reasons with existing code in
BioMaterialEventData
getEntryDate()
.
LoggableData
This is a tagging interface that indicates that the DbLogManagerFactory