Projekt

Obecné

Profil

Stáhnout (1.48 KB) Statistiky
| Větev: | Revize:
1 58fdf8f4 Vojtěch Danišík
package vldc.aswi.domain;
2
3
import lombok.Data;
4
import lombok.EqualsAndHashCode;
5
import lombok.NoArgsConstructor;
6
import vldc.aswi.domain.parameter.Parameter;
7
import vldc.aswi.domain.parameter.ParameterInConfiguration;
8 21d41302 mlinha
9 93fff090 Vojtěch Danišík
import javax.persistence.*;
10 58fdf8f4 Vojtěch Danišík
import java.util.List;
11
12
/**
13
 * Domain entity representing Location in application.
14
 */
15
@Entity(name = "Umisteni")
16
@Data
17
@EqualsAndHashCode(callSuper = true)
18
@NoArgsConstructor
19
public class Location extends EntityParent {
20
21
    /** Name of location. */
22 21d41302 mlinha
    @Column(name = "nazev")
23 58fdf8f4 Vojtěch Danišík
    private String name;
24
25
    /** List of parameters which allows this location. */
26 93fff090 Vojtěch Danišík
    @ManyToMany(mappedBy = "locations", cascade = {CascadeType.ALL})
27 58fdf8f4 Vojtěch Danišík
    private List<Parameter> parameters;
28
29
    /** List of parametersInConfiguration which using this location. */
30 93fff090 Vojtěch Danišík
    @OneToMany(mappedBy = "location", cascade = {CascadeType.ALL})
31 58fdf8f4 Vojtěch Danišík
    private List<ParameterInConfiguration> parametersInConfiguration;
32
33
    /**
34
     * Constructor.
35
     * @param name - Name of location.
36
     */
37
    public Location(String name) {
38
        this.setName(name);
39
    }
40 93fff090 Vojtěch Danišík
41 ba8b306a Vojtěch Danišík
    /**
42
     * Equal method for comparing two objects.
43
     * @param obj - Comparing object.
44
     * @return true if objects are same.
45
     */
46 93fff090 Vojtěch Danišík
    @Override
47
    public boolean equals(Object obj) {
48
        return super.equals(obj);
49
    }
50 7638be72 Vojtěch Danišík
51
    /**
52
     * Overriding toString method to prevent StackOverflowError.
53
     * @return Object with zero parameters.
54
     */
55
    @Override
56
    public String toString() {
57
        return "Location[]";
58
    }
59 58fdf8f4 Vojtěch Danišík
}