1
|
package vldc.aswi.domain;
|
2
|
|
3
|
import lombok.Data;
|
4
|
import lombok.EqualsAndHashCode;
|
5
|
import lombok.NoArgsConstructor;
|
6
|
import vldc.aswi.domain.parameter.ParameterInConfiguration;
|
7
|
|
8
|
import javax.persistence.*;
|
9
|
import java.util.List;
|
10
|
|
11
|
/**
|
12
|
* Domain entity representing Sestava in application.
|
13
|
*/
|
14
|
@Entity(name = "Konfigurace")
|
15
|
@Data
|
16
|
@EqualsAndHashCode(callSuper = true)
|
17
|
@NoArgsConstructor
|
18
|
public class Configuration extends EntityParent {
|
19
|
|
20
|
/** Name of configuration. */
|
21
|
@Column(name = "nazev")
|
22
|
private String name;
|
23
|
|
24
|
/** Name of contingent table. */
|
25
|
@Column(name = "nazev_tabulky")
|
26
|
private String tableName;
|
27
|
|
28
|
/** Specific user, which created this configuration. */
|
29
|
@ManyToOne(fetch= FetchType.LAZY)
|
30
|
@JoinColumn(name = "uzivatel_id")
|
31
|
private User user;
|
32
|
|
33
|
/** Used assembly as template in configuration. */
|
34
|
@ManyToOne(fetch= FetchType.LAZY)
|
35
|
@JoinColumn(name = "sestava_id")
|
36
|
private Assembly assembly;
|
37
|
|
38
|
/** List of parametersInConfiguration, which is part of this configuration. */
|
39
|
@OneToMany(mappedBy = "configuration")
|
40
|
private List<ParameterInConfiguration> parametersInConfiguration;
|
41
|
|
42
|
/**
|
43
|
* Constructor.
|
44
|
* @param name - Name of configuration.
|
45
|
* @param tableName - Name of contingent table.
|
46
|
*/
|
47
|
public Configuration(String name, String tableName) {
|
48
|
this.setName(name);
|
49
|
this.setTableName(tableName);
|
50
|
}
|
51
|
}
|