2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.model
.common
;
13 import org
.apache
.log4j
.Logger
;
17 import javax
.persistence
.*;
22 * @created 08-Nov-2007 13:06:10
25 public abstract class AnnotatableEntity
<T
extends AnnotatableEntity
> extends VersionableEntity
<T
> {
26 static Logger logger
= Logger
.getLogger(AnnotatableEntity
.class);
28 protected Set
<Marker
> markers
= new HashSet();
29 protected Set
<Annotation
> annotations
= new HashSet();
32 public AnnotatableEntity() {
34 // TODO Auto-generated constructor stub
37 @OneToMany //(mappedBy="markedObj")
38 public Set
<Marker
> getMarkers(){
41 public void addMarker(Marker marker
){
42 marker
.setMarkedObj(this);
44 public void removeMarker(Marker marker
){
45 marker
.setMarkedObj(null);
47 protected void setMarkers(Set
<Marker
> markers
) {
48 this.markers
= markers
;
52 @OneToMany //(mappedBy="annotatedObj")
53 public Set
<Annotation
> getAnnotations(){
54 return this.annotations
;
56 public void addAnnotations(Annotation annotation
){
57 annotation
.setAnnotatedObj(this);
59 public void removeAnnotations(Annotation annotation
){
60 annotation
.setAnnotatedObj(null);
62 protected void setAnnotations(Set
<Annotation
> annotations
) {
63 this.annotations
= annotations
;