source: src/main/java/com/tourMate/entities/HotelsImages.java@ 07f4e8b

Last change on this file since 07f4e8b was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 6 months ago

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.tourMate.entities;
2
3import jakarta.persistence.*;
4import org.jetbrains.annotations.NotNull;
5
6@Entity
7@Table(name = "HotelsImages", schema = "public")
8
9public class HotelsImages {
10 private long hotelImageID;
11 private Hotels hotel;
12 private String url;
13
14 public HotelsImages(Hotels hotel, String url) {
15 this.hotel = hotel;
16 this.url = url;
17 }
18
19 public HotelsImages() {
20 }
21
22 @Id
23 @GeneratedValue(strategy = GenerationType.IDENTITY)
24 @Column(name = "image_id", unique = true, nullable = false)
25 public long getHotelImageID() {
26 return hotelImageID;
27 }
28
29 public void setHotelImageID(long hotelImageID) {
30 this.hotelImageID = hotelImageID;
31 }
32
33 @ManyToOne(fetch = FetchType.LAZY)
34 @JoinColumn(name = "hotel_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_hotelimg_kon_hotel"))
35 public Hotels getHotel() {
36 return hotel;
37 }
38
39 public void setHotel(Hotels hotel) {
40 this.hotel = hotel;
41 }
42
43 @Column(name="image_url",unique = false,nullable = false)
44 @NotNull
45 public String getUrl() {
46 return url;
47 }
48
49 public void setUrl(String url) {
50 this.url = url;
51 }
52}
Note: See TracBrowser for help on using the repository browser.