package com.hotels.models;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "hotel")
public class Hotel implements Serializable{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    private Long id;

    @Column(length = 50, nullable = false)
    private String name;

    @Column(length = 50, nullable = false)
    private String address;

    @Column(length = 50, nullable = false)
    private String email;

    @Column(nullable = false)
    private int phone;

    @Column(nullable = false)
    private int category;

    @Column(length = 50, nullable = false)
    private String description;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "hotel", cascade={CascadeType.ALL})
    private List<Room> rooms;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "hotel", cascade={CascadeType.ALL})
    private List<String> facilities;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getPhone() {
        return phone;
    }

    public void setPhone(int phone) {
        this.phone=phone;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category=category;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<Room> getRoomNr() {
        return rooms;
    }

    public void setRoomNr(List<Room> rooms) {
        this.rooms = rooms;
    }

    public List<String> getFacilities() {
        return facilities;
    }

    public void setFacilities(List<String> facilities) {
        this.facilities = facilities;
    }
}

@@ -11,16 +11,24 @@
 m.hotels
+amdrooms
 .models;
@@ -332,32 +332,33 @@
 lumn(length = 50
+0
 , nullable = fal
@@ -405,32 +405,33 @@
 lumn(length = 50
+0
 , nullable = fal
@@ -416,35 +416,33 @@
  = 500, nullable
- = 
+=
 false)%0D%0A    priv
@@ -479,32 +479,33 @@
 lumn(length = 50
+0
 , nullable = fal
@@ -490,35 +490,33 @@
  = 500, nullable
- = 
+=
 false)%0D%0A    priv
@@ -530,65 +530,8 @@
 ing 
-email;%0D%0A%0D%0A    @Column(nullable = false)%0D%0A    private int 
 phon
@@ -548,32 +548,26 @@
 @Column(
-nullable = false
+length=500
 )%0D%0A    p
@@ -573,18 +573,20 @@
 private 
-in
+floa
 t catego
@@ -615,34 +615,18 @@
 gth = 50
-, nullable = false
+00
 )%0D%0A    p
@@ -664,87 +664,63 @@
    @
-OneToMany(fetch = FetchType.LAZY, mappedBy = %22hotel%22, cascade=%7BCascadeType.ALL%7D
+Column%0D%0A    @ElementCollection(targetClass=String.class
 )%0D%0A 
@@ -731,28 +731,30 @@
 rivate List%3C
-Room
+String
 %3E rooms;%0D%0A%0D%0A
@@ -760,89 +760,63 @@
 %0A   
- @OneToMany(fetch = FetchType.LAZY, mappedBy = %22hotel%22, cascade=%7BCascadeType.ALL%7D
+@Column%0D%0A   @ElementCollection(targetClass=String.class
 )%0D%0A 
@@ -1136,149 +1136,8 @@
 ing 
-getEmail() %7B%0D%0A        return email;%0D%0A    %7D%0D%0A%0D%0A    public void setEmail(String email) %7B%0D%0A        this.email = email;%0D%0A    %7D%0D%0A%0D%0A    public int 
 getP
@@ -1203,19 +1203,22 @@
 etPhone(
+Str
 in
-t
+g
  phone) 
@@ -1238,17 +1238,19 @@
 is.phone
-=
+ = 
 phone;%0D%0A
@@ -1269,18 +1269,20 @@
  public 
-in
+floa
 t getCat
@@ -1355,18 +1355,20 @@
 ategory(
-in
+floa
 t catego
@@ -1768,20 +1768,22 @@
 ic List%3C
-Room
+String
 %3E getRoo
@@ -1787,24 +1787,12 @@
 Room
-Nr
 () %7B
-%0D%0A        
 retu
@@ -1796,26 +1796,24 @@
 eturn rooms;
-%0D%0A
     %7D%0D%0A%0D%0A   
@@ -1836,20 +1836,20 @@
 Room
-Nr
 (List%3C
-Room
+String
 %3E ro
@@ -1850,34 +1850,24 @@
 ng%3E rooms) %7B
-%0D%0A        
 this.rooms =
@@ -1873,18 +1873,16 @@
 = rooms;
-%0D%0A
     %7D%0D%0A%0D
@@ -1916,19 +1916,17 @@
 tFacilit
-ies
+y
 () %7B%0D%0A  
@@ -1986,19 +1986,17 @@
 tFacilit
-ies
+y
 (List%3CSt

Update Hotel.java