Projekt

Obecné

Profil

Stáhnout (1.35 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.Assembly;
7
import vldc.aswi.domain.EntityParent;
8

    
9
import javax.persistence.*;
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, cascade = {CascadeType.ALL})
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
    /**
30
     * Constructor.
31
     * @param value - Value that can be used in specific parameter.
32
     */
33
    public ParameterValue(String value) {
34
        this.setValue(value);
35
    }
36

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

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