source: src/main/java/com/example/model/Band.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.1 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 = "bendovi")
17public class Band extends User {
18
19 @Column(name = "cena")
20 Integer price;
21
22 public Band(String name, String username, String number, String password, Integer price, Role role) {
23 super(name, username, number, password, role);
24 this.price = price;
25 }
26
27 @ManyToMany(mappedBy = "bandList")
28 List<Event> eventList;
29 public Band() {
30 }
31
32// @Override
33// public Collection<? extends GrantedAuthority> getAuthorities() {
34// return Collections.singletonList(Role.ROLE_BAND);
35// }
36
37 @Override
38 public boolean equals(Object o) {
39 if (this == o) return true;
40 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
41 Band that = (Band) o;
42 return id != null && Objects.equals(id, that.id);
43 }
44}
Note: See TracBrowser for help on using the repository browser.