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
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.hibernate
.annotations
.Cascade
;
14 import org
.hibernate
.annotations
.CascadeType
;
16 import javax
.persistence
.*;
19 * This class aims to make available some "flags" for identifiable entities in a
20 * flexible way. Application developers (and even users) can define their own
21 * "flags" as a MarkerType.
24 * @created 08-Nov-2007 13:06:33
27 public class Marker
extends VersionableEntity
{
28 private static final Logger logger
= Logger
.getLogger(Marker
.class);
31 private MarkerType markerType
;
32 private AnnotatableEntity markedObj
;
36 * @param markerType The type of the marker
37 * @param flag The value of the marker
40 public static Marker
NewInstance(MarkerType markerType
, boolean flag
){
41 return new Marker(markerType
, flag
);
48 protected Marker(MarkerType markerType
, boolean flag
){
49 this.markerType
= markerType
;
58 public AnnotatableEntity
getMarkedObj() {
61 protected void setMarkedObj(AnnotatableEntity newMarkedObject
) {
62 this.markedObj
= newMarkedObject
;
69 @Cascade({CascadeType
.SAVE_UPDATE
})
70 public MarkerType
getMarkerType(){
71 return this.markerType
;
73 public void setMarkerType(MarkerType type
){
74 this.markerType
= type
;
81 public boolean getFlag(){
84 public void setFlag(boolean flag
){