Line | |
---|
1 | package com.example.model;
|
---|
2 |
|
---|
3 | import com.example.model.Enumerations.Role;
|
---|
4 | import lombok.Data;
|
---|
5 | import org.hibernate.Hibernate;
|
---|
6 |
|
---|
7 | import javax.persistence.Column;
|
---|
8 | import javax.persistence.Entity;
|
---|
9 | import javax.persistence.ManyToMany;
|
---|
10 | import javax.persistence.Table;
|
---|
11 | import java.util.List;
|
---|
12 | import java.util.Objects;
|
---|
13 |
|
---|
14 | @Data
|
---|
15 | @Entity
|
---|
16 | @Table(name = "bendovi")
|
---|
17 | public 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.