Projekt

Obecné

Profil

Stáhnout (1002 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
package cz.zcu.kiv.backendapi.alternativename;
2

    
3
import cz.zcu.kiv.backendapi.catalog.CatalogItem;
4
import lombok.Getter;
5
import lombok.NoArgsConstructor;
6
import lombok.Setter;
7

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

    
11
/**
12
 * Alternative name entity representing alternative name of catalog item
13
 */
14
@Getter
15
@Setter
16
@NoArgsConstructor
17
@Entity
18
@Table(name = "alternative_names")
19
public class AlternativeName {
20
    /**
21
     * Id
22
     */
23
    @Id
24
    @GeneratedValue
25
    private UUID id;
26

    
27
    /**
28
     * Name
29
     */
30
    private String name;
31

    
32
    /**
33
     * Catalog entity
34
     */
35
    @ManyToOne(fetch = FetchType.LAZY)
36
    @JoinColumn(name = "catalog_item_id")
37
    private CatalogItem catalogItem;
38

    
39
    /**
40
     * Creates new alternative name with name and catalog item
41
     *
42
     * @param name        name
43
     * @param catalogItem catalog item
44
     */
45
    public AlternativeName(String name, CatalogItem catalogItem) {
46
        this.name = name;
47
        this.catalogItem = catalogItem;
48
    }
49
}
(1-1/2)