UserAttribute.java
3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package org.legrog.entities;
import javax.persistence.*;
@Entity
public class UserAttribute {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int userAttributeId;
public int getUserAttributeId() {
return userAttributeId;
}
/**
* The linked user.
*/
@ManyToOne
@JoinColumn(name = "USER_ID")
private User user;
/**
* Retrieve the user this attribute is attached to.
* @hibernate.many-to-one
* column="ID_UTILISATEUR"
* class="org.roliste.data.db.User"
* not-null="true"
* access="property"
* lazy="proxy"
* properties-name="PropertyPerUser"
* foreign-key="FK_ATTRIBUTUTILISATEUR_UTILISATEUR"
* @return the {link org.roliste.data.db.User} this attribute is attached to.
* Shall not be <code>null</code>.
* see #setUser(org.roliste.data.db.User)
*/
public User getUser() {
return user;
}
/**
* Set the user this attribute is attached to.
* @param user the new {link org.roliste.data.db.User} this attribute will be attached to. Shall not be <code>null</code>.
* @see #getUser()
*/
public void setUser(User user) {
this.user = user;
}
/**
* The linked property.
*/
@ManyToOne
@JoinColumn(name = "USER_PROPERTY_ID")
private UserProperty userProperty;
/**
* Retrieve the property this attribute is attached to.
* @hibernate.many-to-one
* column="ID_PROP"
* class="org.roliste.data.db.UserProperty"
* not-null="true"
* access="property"
* lazy="false"
* properties-name="PropertyPerUser"
* foreign-key="FK_ATTRIBUTUTILISATEUR_PROPRIETE"
* @return the {link org.roliste.data.db.UserProperty} this attribute is attached to.
* Shall not be <code>null</code>.
* see #setProperty(org.roliste.data.db.UserProperty)
*/
public UserProperty getProperty() {
return userProperty;
}
/**
* Set the property this attribute is attached to.
* @param prop the new {link org.roliste.data.db.UserProperty} this attribute will be attached to. Shall not be <code>null</code>.
* @see #getProperty()
*/
public void setProperty(UserProperty prop) {
userProperty = prop;
}
/**
* The property value.
*/
private String value;
/**
* Returns the property value.
* @return the {@link String} value. If property is known to be some other kind of value, you shall
* convert it yourself. May be <code>null</code>, in cases where the sole existence of the attribute
* is the value, or for unset attributes.
* @see #setValue(String)
* @hibernate.property
* column="ATTR_VALUE"
* access="property"
* length="200"
*/
public String getValue() {
return value;
}
/**
* Initializes attribute value.
* @param value the new {@link String} value.
* @see #getValue()
*/
public void setValue(String value) {
this.value = value;
}
/**
* Returns a string representation of this user attribute definition.
* @return a string representing this user attribute definition.
* @hidden
*/
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("ID_ATTR=");
sb.append(getUserAttributeId());
sb.append(" ATTR_PROP=");
sb.append(userProperty);
sb.append(" ATTR_VALUE=");
sb.append(value);
return sb.toString();
}
}