source: src/main/java/com/example/model/Photographer.java

Last change on this file was a51a591, checked in by colovik <j.colovik@…>, 14 months ago

final

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.model;
2
3import com.example.model.Enumerations.Role;
4import lombok.Data;
5import org.hibernate.Hibernate;
6
7import javax.persistence.Column;
8import javax.persistence.Entity;
9import javax.persistence.ManyToMany;
10import javax.persistence.Table;
11import java.util.List;
12import java.util.Objects;
13
14@Data
15@Entity
16@Table (name = "fotografi")
17public class Photographer extends User{
18
19 @Column(name = "cena")
20 Integer price;
21
22 String portfolio;
23
24 @ManyToMany(mappedBy = "photographerList")
25 List<Event> eventList;
26
27 public Photographer(String name, String username, String number, String password,
28 Integer price, String portfolio, Role role) {
29 super(name, username, number, password, role);
30 this.price = price;
31 this.portfolio = portfolio;
32 }
33
34 public Photographer() {
35 }
36
37// @Override
38// public Collection<? extends GrantedAuthority> getAuthorities() {
39// return Collections.singletonList(Role.ROLE_PHOTOGRAPHER);
40// }
41
42 @Override
43 public boolean equals(Object o) {
44 if (this == o) return true;
45 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
46 Photographer that = (Photographer) o;
47 return id != null && Objects.equals(id, that.id);
48 }
49}
Note: See TracBrowser for help on using the repository browser.