Changeset 07f4e8b for src/main/java/com/tourMate/entities
- Timestamp:
- 01/24/24 17:42:28 (5 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- Location:
- src/main/java/com/tourMate/entities
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/tourMate/entities/Business.java
r5528b99 r07f4e8b 88 88 } 89 89 90 @OneToOne(fetch = FetchType. LAZY)90 @OneToOne(fetch = FetchType.EAGER) 91 91 @JoinColumn(name = "owner_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_biznis_kon_korisnik")) 92 92 public User getUser() { … … 107 107 this.approved = approved; 108 108 } 109 109 110 } -
src/main/java/com/tourMate/entities/HotelRoom.java
r5528b99 r07f4e8b 1 <<<<<<< HEAD2 1 package com.tourMate.entities; 3 2 … … 160 159 } 161 160 } 162 =======163 package com.tourMate.entities;164 165 import jakarta.persistence.*;166 import com.fasterxml.jackson.annotation.JsonIgnore;167 168 import javax.validation.constraints.NotNull;169 170 @Entity171 @Table(name="hotel_rooms", schema = "public")172 public class HotelRoom {173 private long hotelRoomId;174 @JsonIgnore175 private Hotels hotel;176 private String hotelRoomDescription;177 @Enumerated(EnumType.STRING)178 private String hotelRoomName;179 private double price;180 private Boolean kitchenAvailable;181 private Boolean airConditioning;182 private Boolean balcony;183 184 public HotelRoom(long hotelRoomId, Hotels hotel, String hotelRoomDescription, String hotelRoomName, double price, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony) {185 this.hotelRoomId = hotelRoomId;186 this.hotel = hotel;187 this.hotelRoomDescription = hotelRoomDescription;188 this.hotelRoomName = hotelRoomName;189 this.price = price;190 this.kitchenAvailable = kitchenAvailable;191 this.airConditioning = airConditioning;192 this.balcony = balcony;193 }194 195 public HotelRoom(Hotels hotel, String hotelRoomDescription, String type,196 Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {197 this.hotel = hotel;198 this.hotelRoomDescription = hotelRoomDescription;199 this.hotelRoomName = type;200 this.kitchenAvailable = kitchenAvailable;201 this.airConditioning = airConditioning;202 this.balcony = balcony;203 this.price = price;204 }205 206 public HotelRoom(String hotelRoomDescription, String type,207 Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {208 this.hotel = hotel;209 this.hotelRoomDescription = hotelRoomDescription;210 this.hotelRoomName = type;211 this.kitchenAvailable = kitchenAvailable;212 this.airConditioning = airConditioning;213 this.balcony = balcony;214 this.price = price;215 }216 217 public HotelRoom() {218 219 }220 221 @Id222 @GeneratedValue(strategy = GenerationType.IDENTITY)223 @Column(name = "room_id",unique = true,nullable = false)224 public long getHotelRoomId() {225 return hotelRoomId;226 }227 228 public void setHotelRoomId(long hotelRoomId) {229 this.hotelRoomId = hotelRoomId;230 }231 232 @ManyToOne(fetch = FetchType.LAZY)233 @JoinColumn(name = "hotel_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_room_kon_hotel"))234 public Hotels getHotel() {235 return hotel;236 }237 238 public void setHotel(Hotels hotelId) {239 this.hotel = hotelId;240 }241 242 @Column(name="hotel_room_description",unique = false,nullable = false)243 @NotNull244 public String getHotelRoomDescription() {245 return hotelRoomDescription;246 }247 248 public void setHotelRoomDescription(String hotelRoomDescription) {249 this.hotelRoomDescription = hotelRoomDescription;250 }251 252 @Column(name="hotel_room_price",unique = false,nullable = false)253 @NotNull254 public double getPrice() {255 return price;256 }257 258 @Column(name="hotel_room_name",unique = false,nullable = false)259 @NotNull260 public String getHotelRoomName() {261 return hotelRoomName;262 }263 264 265 public void setHotelRoomName(String name) {266 this.hotelRoomName = name;267 }268 public void setPrice(double type) {269 this.price = type;270 }271 @Column(name="hotel_room_kitchen",unique = false,nullable = false)272 @NotNull273 public Boolean getKitchenAvailable() {274 return kitchenAvailable;275 }276 277 public void setKitchenAvailable(Boolean kitchenAvailable) {278 this.kitchenAvailable = kitchenAvailable;279 }280 @Column(name="hotel_room_ac",unique = false,nullable = false)281 @NotNull282 public Boolean getAirConditioning() {283 return airConditioning;284 }285 286 public void setAirConditioning(Boolean airConditioning) {287 this.airConditioning = airConditioning;288 }289 @Column(name="hotel_room_balcony",unique = false,nullable = false)290 @NotNull291 public Boolean getBalcony() {292 return balcony;293 }294 295 public void setBalcony(Boolean balcony) {296 this.balcony = balcony;297 }298 }299 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl) -
src/main/java/com/tourMate/entities/HotelRoomReservations.java
r5528b99 r07f4e8b 43 43 } 44 44 45 @ManyToOne(fetch = FetchType. LAZY)45 @ManyToOne(fetch = FetchType.EAGER) 46 46 @JoinColumn(name = "room_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_room")) 47 47 public HotelRoom getHotelRoom() { … … 59 59 } 60 60 61 @OneToOne(fetch = FetchType. LAZY)61 @OneToOne(fetch = FetchType.EAGER) 62 62 @JoinColumn(name = "user_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_user")) 63 63 public User getUser() { -
src/main/java/com/tourMate/entities/RestaurantImages.java
r5528b99 r07f4e8b 31 31 } 32 32 33 @ManyToOne(fetch = FetchType. LAZY)33 @ManyToOne(fetch = FetchType.EAGER) 34 34 @JoinColumn(name="restaurant_id",unique = false,nullable = false,foreignKey = @ForeignKey(name = "fk_ref_od_restimg_kon_restoran")) 35 35 public Restaurant getRestaurant() { -
src/main/java/com/tourMate/entities/RestaurantReservations.java
r5528b99 r07f4e8b 82 82 } 83 83 84 @ManyToOne(fetch = FetchType. LAZY)84 @ManyToOne(fetch = FetchType.EAGER) 85 85 @JoinColumn(name = "user_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_rezervacija_restoran_kon_korisnik")) 86 86 public User getUser() { -
src/main/java/com/tourMate/entities/Reviews.java
r5528b99 r07f4e8b 75 75 76 76 @ManyToOne(fetch = FetchType.LAZY) 77 @JoinColumn(name = "hotel_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_hotel"))77 @JoinColumn(name = "hotel_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_hotel")) 78 78 public Hotels getHotel () { 79 79 return hotel; … … 85 85 86 86 @ManyToOne(fetch = FetchType.LAZY) 87 @JoinColumn(name = "restaurant_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_restorani"))87 @JoinColumn(name = "restaurant_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_restorani")) 88 88 public Restaurant getRestaurant () { 89 89 return restaurant; … … 95 95 96 96 @ManyToOne(fetch = FetchType.LAZY) 97 @JoinColumn(name = "transport_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_transport"))97 @JoinColumn(name = "transport_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_transport")) 98 98 public Transport getTransport () { 99 99 return transport; -
src/main/java/com/tourMate/entities/User.java
r5528b99 r07f4e8b 52 52 private Role role; 53 53 @Column(name = "locked", unique = false, nullable = false) 54 boolean locked ;54 boolean locked = false; 55 55 56 56 @Column(name = "enabled", unique = false, nullable = false) … … 96 96 } 97 97 98 public boolean isLocked() { 99 return locked; 100 } 98 101 99 102 public long getUserID() { … … 162 165 @Override 163 166 public boolean isAccountNonLocked() { 164 return true;167 return locked; 165 168 } 166 169
Note:
See TracChangeset
for help on using the changeset viewer.