Package net.sf.basedb.core.data
Class AnnotationData
- java.lang.Object
-
- net.sf.basedb.core.data.BasicData
-
- net.sf.basedb.core.data.AnnotationData
-
- All Implemented Interfaces:
IdentifiableData
,LoggableData
public class AnnotationData extends BasicData implements LoggableData
This class holds information about an annotation- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Annotation
, Developer documentation: Annotations- Hibernate: class
- table="`Annotations`" lazy="false"
-
-
Field Summary
Fields Modifier and Type Field Description private AnnotationSetData
annotationSet
private AnnotationTypeData
annotationType
private AnnotationData
inheritedFrom
private Set<AnnotationData>
inheritingAnnotations
private Date
lastUpdate
private int
overrideId
private int
projectId
private int
source
private UnitData
unit
private ParameterValueData<?>
values
-
Constructor Summary
Constructors Constructor Description AnnotationData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationSetData
getAnnotationSet()
Get the annotation set this annotation primarily belongs to.AnnotationTypeData
getAnnotationType()
Get the type of this annotation.AnnotationData
getInheritedFrom()
The parent annotation if this is an inherited or cloned annotation.(package private) Set<AnnotationData>
getInheritingAnnotations()
Other annotations which inherit this annotation.Date
getLastUpdate()
Get the date and time the values in this annotation was last updated.int
getOverrideId()
The ID of the default annotation that this project-specific annotation is overriding. 0 for default annotations.int
getProjectId()
The ID of the project that this annotation belongs to. 0 is used for default annotations.int
getSource()
The annotation source. 0 = primary, 1 = inherited, 2 = cloned For primary annotations, only one annotation per annotation type is supported.UnitData
getUnit()
Get the unit used for the annotation values.ParameterValueData<?>
getValues()
The values of this annotation.void
setAnnotationSet(AnnotationSetData annotationSet)
void
setAnnotationType(AnnotationTypeData annotationType)
void
setInheritedFrom(AnnotationData inheritedFrom)
(package private) void
setInheritingAnnotations(Set<AnnotationData> inheritingAnnotations)
void
setLastUpdate(Date lastUpdate)
void
setOverrideId(int overrideId)
void
setProjectId(int projectId)
void
setSource(int source)
void
setUnit(UnitData unit)
void
setValues(ParameterValueData<?> values)
-
Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
-
-
-
-
Field Detail
-
annotationSet
private AnnotationSetData annotationSet
-
annotationType
private AnnotationTypeData annotationType
-
projectId
private int projectId
-
overrideId
private int overrideId
-
source
private int source
-
inheritedFrom
private AnnotationData inheritedFrom
-
unit
private UnitData unit
-
values
private ParameterValueData<?> values
-
lastUpdate
private Date lastUpdate
-
inheritingAnnotations
private Set<AnnotationData> inheritingAnnotations
-
-
Method Detail
-
getAnnotationSet
public AnnotationSetData getAnnotationSet()
Get the annotation set this annotation primarily belongs to.- Hibernate: column
- name="`annotationset_id`" not-null="true"
- Hibernate: many-to-one
- outer-join="false" update="false"
-
setAnnotationSet
public void setAnnotationSet(AnnotationSetData annotationSet)
-
getAnnotationType
public AnnotationTypeData getAnnotationType()
Get the type of this annotation.- Hibernate: column
- name="`annotationtype_id`" not-null="true"
- Hibernate: many-to-one
- outer-join="false" update="false"
-
setAnnotationType
public void setAnnotationType(AnnotationTypeData annotationType)
-
getProjectId
public int getProjectId()
The ID of the project that this annotation belongs to. 0 is used for default annotations.- Hibernate: property
- type="int"
- Hibernate: column
- name="`project_id`" not-null="true" update="false" index="project_idx"
-
setProjectId
public void setProjectId(int projectId)
-
getOverrideId
public int getOverrideId()
The ID of the default annotation that this project-specific annotation is overriding. 0 for default annotations.- Hibernate: property
- type="int"
- Hibernate: column
- name="`override_id`" not-null="true" update="false" index="override_idx"
-
setOverrideId
public void setOverrideId(int overrideId)
-
getSource
public int getSource()
The annotation source. 0 = primary, 1 = inherited, 2 = cloned For primary annotations, only one annotation per annotation type is supported. Inherited annotations should take values, units, etc. from the parent annotation Cloned annotations may have different values and units due to changes on the parent item or this item. The link to the parent item can be lost if the annotation is deleted from the parent.- Since:
- 3.6
- Hibernate: property
- column="`source`" type="int" not-null="true" update="false"
-
setSource
public void setSource(int source)
-
getInheritedFrom
public AnnotationData getInheritedFrom()
The parent annotation if this is an inherited or cloned annotation. Null otherwise. NOTE! Can be null also for cloned annotations if the parent annotation has been deleted.- Since:
- 3.6
- Hibernate: many-to-one
- column="`inherited_id`" not-null="false" update="false" outer-join="false"
-
setInheritedFrom
public void setInheritedFrom(AnnotationData inheritedFrom)
-
getUnit
public UnitData getUnit()
Get the unit used for the annotation values. NOTE! The value is always null for annotation types that doesn't specify a quantity, and is always not null for annotation types that does. It is not possible to change between null and non-null.- Since:
- 2.9
- Hibernate: many-to-one
- column="`unit_id`" not-null="false" outer-join="false"
-
setUnit
public void setUnit(UnitData unit)
- Since:
- 2.9
-
getValues
public ParameterValueData<?> getValues()
The values of this annotation.- Hibernate: many-to-one
- column="`value_id`" not-null="false" update="false" cascade="all" unique="true"
-
setValues
public void setValues(ParameterValueData<?> values)
-
getLastUpdate
public Date getLastUpdate()
Get the date and time the values in this annotation was last updated.- Returns:
- A
Date
object, or null if not known - Hibernate: property
- column="`last_update`" type="timestamp" not-null="false"
-
setLastUpdate
public void setLastUpdate(Date lastUpdate)
-
getInheritingAnnotations
Set<AnnotationData> getInheritingAnnotations()
Other annotations which inherit this annotation. This is the inverse end. seegetInheritedFrom()
- Hibernate: set
- lazy="true" inverse="true" cascade="delete"
- Hibernate: collection-key
- column="`inherited_id`"
- Hibernate: collection-one-to-many
- class="net.sf.basedb.core.data.AnnotationData"
-
setInheritingAnnotations
void setInheritingAnnotations(Set<AnnotationData> inheritingAnnotations)
-
-