Project

General

Profile

Download (1.46 KB) Statistics
| Branch: | Tag: | Revision:
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
import org.apache.log4j.Logger;
13
import org.hibernate.annotations.Cascade;
14
import org.hibernate.annotations.CascadeType;
15

    
16
import java.util.*;
17
import javax.persistence.*;
18

    
19
/**
20
 * @author m.doering
21
 * @version 1.0
22
 * @created 08-Nov-2007 13:06:15
23
 */
24
@Entity
25
public class CategoricalData extends DescriptionElementBase {
26
	static Logger logger = Logger.getLogger(CategoricalData.class);
27

    
28
	
29
	//whether the sequence of ordered states is important
30
	private boolean orderRelevant;
31
	private List<State> states = new ArrayList();
32

    
33
	
34
	/**
35
	 * Factory method
36
	 * @return
37
	 */
38
	public static CategoricalData NewInstance(){
39
		return new CategoricalData();
40
	}
41
	
42
	protected CategoricalData() {
43
		super(null);
44
	}
45
	
46
	@ManyToMany
47
	@Cascade({CascadeType.SAVE_UPDATE})
48
	public List<State> getStates(){
49
		return this.states;
50
	}
51
	private void setStates(List<State> states){
52
		this.states = states;
53
	}
54
	public void addState(State state){
55
		this.states.add(state);
56
	}
57
	public void removeState(State state){
58
		this.states.remove(state);
59
	}
60

    
61
	public boolean getOrderRelevant(){
62
		return this.orderRelevant;
63
	}
64
	public void setOrderRelevant(boolean orderRelevant){
65
		this.orderRelevant = orderRelevant;
66
	}
67

    
68
}
(2-2/30)