Ignore:
Timestamp:
01/24/24 17:42:28 (5 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

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  
    8888    }
    8989
    90     @OneToOne(fetch = FetchType.LAZY)
     90    @OneToOne(fetch = FetchType.EAGER)
    9191    @JoinColumn(name = "owner_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_biznis_kon_korisnik"))
    9292    public User getUser() {
     
    107107        this.approved = approved;
    108108    }
     109
    109110}
  • src/main/java/com/tourMate/entities/HotelRoom.java

    r5528b99 r07f4e8b  
    1 <<<<<<< HEAD
    21package com.tourMate.entities;
    32
     
    160159    }
    161160}
    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 @Entity
    171 @Table(name="hotel_rooms", schema = "public")
    172 public class HotelRoom {
    173     private long hotelRoomId;
    174     @JsonIgnore
    175     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     @Id
    222     @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     @NotNull
    244     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     @NotNull
    254     public double getPrice() {
    255         return price;
    256     }
    257 
    258     @Column(name="hotel_room_name",unique = false,nullable = false)
    259     @NotNull
    260     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     @NotNull
    273     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     @NotNull
    282     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     @NotNull
    291     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  
    4343    }
    4444
    45     @ManyToOne(fetch = FetchType.LAZY)
     45    @ManyToOne(fetch = FetchType.EAGER)
    4646    @JoinColumn(name = "room_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_room"))
    4747    public HotelRoom getHotelRoom() {
     
    5959    }
    6060
    61     @OneToOne(fetch = FetchType.LAZY)
     61    @OneToOne(fetch = FetchType.EAGER)
    6262    @JoinColumn(name = "user_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_user"))
    6363    public User getUser() {
  • src/main/java/com/tourMate/entities/RestaurantImages.java

    r5528b99 r07f4e8b  
    3131    }
    3232
    33     @ManyToOne(fetch = FetchType.LAZY)
     33    @ManyToOne(fetch = FetchType.EAGER)
    3434    @JoinColumn(name="restaurant_id",unique = false,nullable = false,foreignKey = @ForeignKey(name = "fk_ref_od_restimg_kon_restoran"))
    3535    public Restaurant getRestaurant() {
  • src/main/java/com/tourMate/entities/RestaurantReservations.java

    r5528b99 r07f4e8b  
    8282    }
    8383
    84     @ManyToOne(fetch = FetchType.LAZY)
     84    @ManyToOne(fetch = FetchType.EAGER)
    8585    @JoinColumn(name = "user_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_rezervacija_restoran_kon_korisnik"))
    8686    public User getUser() {
  • src/main/java/com/tourMate/entities/Reviews.java

    r5528b99 r07f4e8b  
    7575
    7676    @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"))
    7878    public Hotels getHotel () {
    7979        return hotel;
     
    8585
    8686    @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"))
    8888    public Restaurant getRestaurant () {
    8989        return restaurant;
     
    9595
    9696    @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"))
    9898    public Transport getTransport () {
    9999        return transport;
  • src/main/java/com/tourMate/entities/User.java

    r5528b99 r07f4e8b  
    5252    private Role role;
    5353    @Column(name = "locked", unique = false, nullable = false)
    54     boolean locked;
     54    boolean locked = false;
    5555
    5656    @Column(name = "enabled", unique = false, nullable = false)
     
    9696    }
    9797
     98    public boolean isLocked() {
     99        return locked;
     100    }
    98101
    99102    public long getUserID() {
     
    162165    @Override
    163166    public boolean isAccountNonLocked() {
    164         return true;
     167        return locked;
    165168    }
    166169
Note: See TracChangeset for help on using the changeset viewer.