View Javadoc

1   package de.campussource.cse.cdmm.domain;
2   
3   import javax.persistence.Column;
4   import javax.persistence.ManyToOne;
5   import javax.xml.bind.annotation.XmlTransient;
6   
7   import de.campussource.cse.cdmm.Constants;
8   
9   /**
10   * Representation of an persistent attribute
11   * @author Sebastian Roekens
12   *
13   */
14  @XmlTransient
15  public class PersistentAttribute extends Attribute {
16  	
17  	
18  	@Column(name=Constants.COLUMNNAME_NAME, nullable=false, insertable=true, updatable=true)
19  	private String name;
20  	
21  	@Column(name=Constants.COLUMNNAME_VALUE, nullable=false, insertable=true, updatable=true)
22  	private String value;
23  	
24  	@ManyToOne(optional=false)
25  	@Column(name=Constants.COLUMNNAME_ENTITY_ID, nullable=false, insertable=true, updatable=true)
26  	public Entity entity;
27  	
28  	public Entity getEntity() {
29  		return entity;
30  	}
31  
32  	public void setEntity(Entity entity) {
33  		this.entity = entity;
34  	}
35  
36  	@Override
37  	public String getName() {
38  		return name;
39  	}
40  
41  	@Override
42  	public void setName(String name) {
43  		this.name = name;
44  	}
45  
46  	@Override
47  	public String getValue() {
48  		return value;
49  	}
50  
51  	@Override
52  	public void setValue(String value) {
53  		this.value = value;
54  	}
55  
56  	
57  	public PersistentAttribute(){}
58  	
59  	public PersistentAttribute(String name, String value){
60  		setName(name);
61  		setValue(value);
62  		setTransient(false);
63  	}
64  
65  }