1
|
package cz.zcu.kiv.backendapi.bibliography;
|
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.io.Serializable;
|
10
|
import java.util.UUID;
|
11
|
|
12
|
/**
|
13
|
* Bibliography entity representing bibliography
|
14
|
*/
|
15
|
@Getter
|
16
|
@Setter
|
17
|
@NoArgsConstructor
|
18
|
@Entity
|
19
|
@Table(name = "bibliography")
|
20
|
public class Bibliography implements Serializable {
|
21
|
/**
|
22
|
* Id
|
23
|
*/
|
24
|
@Id
|
25
|
@GeneratedValue
|
26
|
private UUID id;
|
27
|
|
28
|
/**
|
29
|
* Source
|
30
|
*/
|
31
|
private String source;
|
32
|
|
33
|
/**
|
34
|
* Catalog item
|
35
|
*/
|
36
|
@ManyToOne(fetch = FetchType.LAZY)
|
37
|
@JoinColumn(name = "catalog_item_id")
|
38
|
private CatalogItem catalogItem;
|
39
|
|
40
|
/**
|
41
|
* Creates new bibliography with source and catalog item
|
42
|
*
|
43
|
* @param source source
|
44
|
* @param catalogItem catalog item
|
45
|
*/
|
46
|
public Bibliography(String source, CatalogItem catalogItem) {
|
47
|
this.source = source;
|
48
|
this.catalogItem = catalogItem;
|
49
|
}
|
50
|
}
|