source: src/main/java/com/example/baza/model/Avtor.java

Last change on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package com.example.baza.model;
2import javax.persistence.*;
3import java.util.LinkedHashSet;
4import java.util.Set;
5
6@Entity
7@Table(name = "avtor", schema = "project")
8public class Avtor {
9 @Id
10 @GeneratedValue(strategy = GenerationType.IDENTITY)
11 @Column(name = "id_na_avtor", nullable = false)
12 private Integer id;
13
14 @Column(name = "ime", nullable = false, length = 100)
15 private String ime;
16
17 @ManyToMany(mappedBy = "avtors")
18 private Set<Knigi> knigis = new LinkedHashSet<>();
19
20 @OneToMany(mappedBy = "avtor")
21 private Set<Ocena> ocenas = new LinkedHashSet<>();
22
23 public Set<Ocena> getOcenas() {
24 return ocenas;
25 }
26
27 public void setOcenas(Set<Ocena> ocenas) {
28 this.ocenas = ocenas;
29 }
30
31 public Set<Knigi> getKnigis() {
32 return knigis;
33 }
34
35 public void setKnigis(Set<Knigi> knigis) {
36 this.knigis = knigis;
37 }
38
39 public String getIme() {
40 return ime;
41 }
42
43 public void setIme(String ime) {
44 this.ime = ime;
45 }
46
47 public Integer getId() {
48 return id;
49 }
50
51 public void setId(Integer id) {
52 this.id = id;
53 }
54}
Note: See TracBrowser for help on using the repository browser.