1
|
package eu.dnetlib.enabling.is.hib.objects;
|
2
|
|
3
|
import java.io.Serializable;
|
4
|
|
5
|
import javax.persistence.EmbeddedId;
|
6
|
import javax.persistence.Entity;
|
7
|
import javax.persistence.Table;
|
8
|
import javax.persistence.Transient;
|
9
|
|
10
|
@Entity(name = "resource_properties")
|
11
|
@Table(name = "resource_properties")
|
12
|
public class HibDnetResourceProperty extends HibDnetObject implements Serializable {
|
13
|
|
14
|
@Transient
|
15
|
private static final long serialVersionUID = -2095052466902711468L;
|
16
|
|
17
|
@EmbeddedId
|
18
|
private HibDnetResourcePropertyId id;
|
19
|
|
20
|
public HibDnetResourceProperty() {}
|
21
|
|
22
|
public HibDnetResourceProperty(final HibDnetResourcePropertyId id) {
|
23
|
this.id = id;
|
24
|
}
|
25
|
|
26
|
public HibDnetResourceProperty(final HibDnetResource resource, final String name, final String value) {
|
27
|
this.id = new HibDnetResourcePropertyId(resource, name, value);
|
28
|
}
|
29
|
|
30
|
public final HibDnetResourcePropertyId getId() {
|
31
|
return id;
|
32
|
}
|
33
|
|
34
|
public final void setId(final HibDnetResourcePropertyId id) {
|
35
|
this.id = id;
|
36
|
}
|
37
|
|
38
|
public String getName() {
|
39
|
return id.getName();
|
40
|
}
|
41
|
|
42
|
public String getValue() {
|
43
|
return id.getValue();
|
44
|
}
|
45
|
|
46
|
@Override
|
47
|
public int hashCode() {
|
48
|
return id.hashCode();
|
49
|
}
|
50
|
}
|