(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / CategoricalData.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.model.description;
11
12
13 import org.apache.log4j.Logger;
14 import org.hibernate.annotations.Cascade;
15 import org.hibernate.annotations.CascadeType;
16
17 import java.util.*;
18 import javax.persistence.*;
19
20 /**
21 * @author m.doering
22 * @version 1.0
23 * @created 08-Nov-2007 13:06:15
24 */
25 @Entity
26 public class CategoricalData extends FeatureBase {
27 static Logger logger = Logger.getLogger(CategoricalData.class);
28 //whether the sequence of ordered states is important
29 private boolean orderRelevant;
30 private List<State> states = new ArrayList();
31
32 public CategoricalData() {
33 super();
34 }
35
36 @ManyToMany
37 @Cascade({CascadeType.SAVE_UPDATE})
38 public List<State> getStates(){
39 return this.states;
40 }
41 private void setStates(List<State> states){
42 this.states = states;
43 }
44 public void addState(State state){
45 this.states.add(state);
46 }
47 public void removeState(State state){
48 this.states.remove(state);
49 }
50
51 public boolean getOrderRelevant(){
52 return this.orderRelevant;
53 }
54 public void setOrderRelevant(boolean orderRelevant){
55 this.orderRelevant = orderRelevant;
56 }
57
58 }