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
;
14 import org
.hibernate
.annotations
.Cascade
;
15 import org
.hibernate
.annotations
.CascadeType
;
18 import javax
.persistence
.*;
21 * This class aims to make available some "flags" for identifiable entities in a
22 * flexible way. Application developers (and even users) can define their own
23 * "flags" as a MarkerType.
26 * @created 08-Nov-2007 13:06:33
29 public class Marker
extends VersionableEntity
{
30 static Logger logger
= Logger
.getLogger(Marker
.class);
32 private MarkerType type
;
33 private AnnotatableEntity markedObj
;
36 public AnnotatableEntity
getMarkedObj() {
39 protected void setMarkedObj(AnnotatableEntity newMarkedObject
) {
40 // Hibernate bidirectional cascade hack:
41 // http://opensource.atlassian.com/projects/hibernate/browse/HHH-1054
42 if(this.markedObj
== newMarkedObject
) return;
43 if (markedObj
!= null) {
44 markedObj
.markers
.remove(this);
46 if (newMarkedObject
!= null) {
47 newMarkedObject
.markers
.add(this);
49 this.markedObj
= newMarkedObject
;
53 @Cascade({CascadeType
.SAVE_UPDATE
})
54 public MarkerType
getType(){
57 public void setType(MarkerType type
){
61 public boolean getFlag(){
64 public void setFlag(boolean flag
){