AccountAttribute.java
3.52 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
package org.legrog.entities;
import javax.persistence.*;
/*
Entité persistante représentant les propriétés qui sont paramétrées pour un utilisateur.
Migréee depuis la v2.
*/
@Entity
public class AccountAttribute {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int userAttributeId;
public int getUserAttributeId() {
return userAttributeId;
}
/**
* The linked account.
*/
@ManyToOne
private Account account;
/**
* Retrieve the account this attribute is attached to.
* hibernate.many-to-one
* column="ID_UTILISATEUR"
* class="org.roliste.data.db.Account"
* not-null="true"
* access="property"
* lazy="proxy"
* properties-name="PropertyPerUser"
* foreign-key="FK_ATTRIBUTUTILISATEUR_UTILISATEUR"
* @return the {link org.roliste.data.db.Account} this attribute is attached to.
* Shall not be <code>null</code>.
* see #setAccount(org.roliste.data.db.Account)
*/
public Account getAccount() {
return account;
}
/**
* Set the account this attribute is attached to.
* @param account the new {link org.roliste.data.db.Account} this attribute will be attached to. Shall not be <code>null</code>.
* @see #getAccount()
*/
public void setAccount(Account account) {
this.account = account;
}
/**
* The linked property.
*/
@ManyToOne
private AccountProperty accountProperty;
/**
* Retrieve the property this attribute is attached to.
* hibernate.many-to-one
* column="ID_PROP"
* class="org.roliste.data.db.AccountProperty"
* not-null="true"
* access="property"
* lazy="false"
* properties-name="PropertyPerUser"
* foreign-key="FK_ATTRIBUTUTILISATEUR_PROPRIETE"
* @return the {link org.roliste.data.db.AccountProperty} this attribute is attached to.
* Shall not be <code>null</code>.
* see #setProperty(org.roliste.data.db.AccountProperty)
*/
public AccountProperty getProperty() {
return accountProperty;
}
/**
* Set the property this attribute is attached to.
* @param prop the new {link org.roliste.data.db.AccountProperty} this attribute will be attached to. Shall not be <code>null</code>.
* @see #getProperty()
*/
public void setProperty(AccountProperty prop) {
accountProperty = 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 account attribute definition.
* @return a string representing this account attribute definition.
* hidden
*/
@Override
public String toString()
{
return "ID_ATTR=" + getUserAttributeId() + " ATTR_PROP=" + accountProperty + " ATTR_VALUE=" + value;
}
}