Rev | Line | |
---|
[a51a591] | 1 | package com.example.model;
|
---|
| 2 |
|
---|
| 3 | import lombok.Getter;
|
---|
| 4 | import lombok.Setter;
|
---|
| 5 |
|
---|
| 6 | import javax.persistence.*;
|
---|
| 7 | import java.util.List;
|
---|
| 8 |
|
---|
| 9 | @Getter
|
---|
| 10 | @Setter
|
---|
| 11 | @Entity
|
---|
| 12 | @Table(name = "lokacii")
|
---|
| 13 | public class Location {
|
---|
| 14 |
|
---|
| 15 | @Id
|
---|
| 16 | @Column(name = "adresa")
|
---|
| 17 | String address;
|
---|
| 18 |
|
---|
| 19 | @Column(name = "cena")
|
---|
| 20 | Integer price;
|
---|
| 21 |
|
---|
| 22 | @OneToMany(mappedBy = "location")
|
---|
| 23 | List<Event> events;
|
---|
| 24 |
|
---|
| 25 | public Location(String address, Integer price) {
|
---|
| 26 | this.address = address;
|
---|
| 27 | this.price = price;
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | public Location() {
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | @Override
|
---|
| 34 | public String toString() {
|
---|
| 35 | return address;
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.