Projekt

Obecné

Profil

Stáhnout (1.5 KB) Statistiky
| Větev: | Revize:
1
package vldc.aswi.domain.parameter;
2

    
3
import lombok.Data;
4
import lombok.EqualsAndHashCode;
5
import lombok.NoArgsConstructor;
6
import vldc.aswi.domain.EntityParent;
7

    
8
import javax.persistence.*;
9
import java.util.List;
10

    
11
/**
12
 * Domain entity representing Parameter in application.
13
 */
14
@Entity(name = "Parametr_hodnota")
15
@Data
16
@EqualsAndHashCode(callSuper = true)
17
@NoArgsConstructor
18
public class ParameterValue extends EntityParent {
19

    
20
    /** Specific parameter which can use this value. */
21
    @ManyToOne(fetch = FetchType.LAZY)
22
    @JoinColumn(name = "parametr_id")
23
    private Parameter parameter;
24

    
25
    /** Value that can be used in specific parameter. */
26
    @Column(name = "hodnota")
27
    private String value;
28

    
29
    /** List of parametersInConfigurations, which using this function. */
30
    @ManyToMany(mappedBy = "selectedParameterValues")
31
    private List<ParameterInConfiguration> parametersInConfigurations;
32

    
33
    /**
34
     * Constructor.
35
     * @param value - Value that can be used in specific parameter.
36
     */
37
    public ParameterValue(String value) {
38
        this.setValue(value);
39
    }
40

    
41
    /**
42
     * Equal method for comparing two objects.
43
     * @param obj - Comparing object.
44
     * @return true if objects are same.
45
     */
46
    @Override
47
    public boolean equals(Object obj) {
48
        return super.equals(obj);
49
    }
50

    
51
    /**
52
     * Overriding toString method to prevent StackOverflowError.
53
     * @return Object with zero parameters.
54
     */
55
    @Override
56
    public String toString() {
57
        return "ParameterValue[]";
58
    }
59
}
(4-4/4)