Index: cimeri-main/src/main/java/com/example/cimeri/model/Apartment.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/Apartment.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/Apartment.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -16,6 +16,6 @@
     private Long buildingid;
     private Long ownerid;
-    private String apartment_adress;
-    private int apartment_size;
+    private String apartmentfloorandroomnumber;
+    private int apartmentsize;
 
     public Apartment() {
@@ -25,6 +25,6 @@
         this.buildingid=buildingid;
         this.ownerid=ownerid;
-        this.apartment_adress=apartment_adress;
-        this.apartment_size=apartment_size;
+        this.apartmentfloorandroomnumber =apartment_adress;
+        this.apartmentsize =apartment_size;
     }
 }
Index: cimeri-main/src/main/java/com/example/cimeri/model/Building.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/Building.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/Building.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -14,13 +14,13 @@
     private Long buildingid;
 
-    private String cityname;
-    private String building_adress;
+    private Long cityid;
+    private String buildingaddress;
 
     public Building() {
     }
 
-    public Building(String cityname, String building_adress) {
-        this.cityname=cityname;
-        this.building_adress=building_adress;
+    public Building(Long cityid, String building_adress) {
+        this.cityid=cityid;
+        this.buildingaddress =building_adress;
     }
 }
Index: cimeri-main/src/main/java/com/example/cimeri/model/City.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/City.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/City.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -10,4 +10,7 @@
 public class City {
     @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long cityid;
+
     private String cityname;
 
Index: cimeri-main/src/main/java/com/example/cimeri/model/Faculty.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/Faculty.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/Faculty.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -15,13 +15,13 @@
 
     private String facultyname;
-    private String cityname;
+    private Long cityid;
 
     public Faculty() {
     }
 
-    public Faculty(Long facultyid, String facultyname, String cityname) {
+    public Faculty(Long facultyid, String facultyname, Long cityid) {
         this.facultyid=facultyid;
         this.facultyname=facultyname;
-        this.cityname=cityname;
+        this.cityid=cityid;
     }
 }
Index: cimeri-main/src/main/java/com/example/cimeri/model/OwnerPost.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/OwnerPost.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/OwnerPost.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -3,6 +3,4 @@
 import jakarta.persistence.*;
 import lombok.Data;
-
-import java.time.LocalDateTime;
 
 
@@ -12,5 +10,5 @@
 public class OwnerPost {
     @Id
-    private Long owner_postid;
+    private Long ownerpostid;
     private Long apartmentid;
     private Long ownerid;
@@ -23,5 +21,5 @@
 
     public OwnerPost(Long owner_postid,Long apartmentid,Long ownerid) {
-        this.owner_postid=owner_postid;
+        this.ownerpostid =owner_postid;
         this.apartmentid=apartmentid;
         this.ownerid=ownerid;
Index: cimeri-main/src/main/java/com/example/cimeri/model/Post.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/Post.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/Post.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -14,8 +14,8 @@
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long postid;
-    private String cityname;
-    private int number_of_roommates;
+    private Long cityid;
+    private int numberofroommates;
     private int price;
-    private LocalDateTime date_posted;
+    private LocalDateTime dateposted;
     private String description;
 
@@ -24,9 +24,9 @@
     }
 
-    public Post(String cityname, int number_of_roommates, int price, LocalDateTime date_posted, String description) {
-        this.cityname=cityname;
-        this.number_of_roommates=number_of_roommates;
+    public Post(Long cityid, int number_of_roommates, int price, LocalDateTime date_posted, String description) {
+        this.cityid=cityid;
+        this.numberofroommates =number_of_roommates;
         this.price=price;
-        this.date_posted=date_posted;
+        this.dateposted =date_posted;
         this.description=description;
     }
Index: cimeri-main/src/main/java/com/example/cimeri/model/StudentPost.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/model/StudentPost.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/model/StudentPost.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -3,6 +3,4 @@
 import jakarta.persistence.*;
 import lombok.Data;
-
-import java.time.LocalDateTime;
 
 
@@ -12,5 +10,5 @@
 public class StudentPost {
     @Id
-    private Long student_postid;
+    private Long studentpostid;
     private Long studentid;
 
@@ -21,5 +19,5 @@
 
     public StudentPost(Long student_postid,Long studentid) {
-        this.student_postid=student_postid;
+        this.studentpostid =student_postid;
         this.studentid=studentid;
 
Index: cimeri-main/src/main/java/com/example/cimeri/repository/ApartmentRepository.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/repository/ApartmentRepository.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/repository/ApartmentRepository.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -20,8 +20,8 @@
 
 
-    @Query("select u.ime,u.prezime,u.phone_number,u.email_address,a.apartment_size,a.apartment_adress,b.building_adress,p.price,photos.photosurl from Building b,User u, Apartment a,Post p,OwnerPost op, Owner o, Photos photos WHERE u.userid=a.ownerid and op.owner_postid=p.postid and op.ownerid=u.userid and o.ownerid=u.userid and o.ownerid=a.ownerid and b.buildingid=a.buildingid and a.apartmentid=op.apartmentid and photos.postid=p.postid and photos.postid=op.owner_postid and p.number_of_roommates=:number_of_roommates and p.price<=:budget and p.cityname=:cityname")
-    List filteredapartments(@Param("cityname")String cityname, @Param("number_of_roommates") int number_of_roommates, @Param("budget") int budget);
+    @Query("select u.ime,u.prezime,u.phone_number,u.email_address,a.apartmentsize,a.apartmentfloorandroomnumber,b.buildingaddress,p.price,photos.photosurl from Building b,User u, Apartment a,Post p,OwnerPost op, Owner o, Photos photos WHERE u.userid=a.ownerid and op.ownerpostid=p.postid and op.ownerid=u.userid and o.ownerid=u.userid and o.ownerid=a.ownerid and b.buildingid=a.buildingid and a.apartmentid=op.apartmentid and photos.postid=p.postid and photos.postid=op.ownerpostid and p.numberofroommates=:number_of_roommates and p.price<=:budget and p.cityid=:cityid")
+    List filteredapartments(@Param("cityid")Long cityid, @Param("number_of_roommates") int number_of_roommates, @Param("budget") int budget);
 
-    @Query("select u.ime,u.prezime,u.phone_number,u.email_address,a.apartment_size,a.apartment_adress,b.building_adress,p.price,photos.photosurl from Building b,User u, Apartment a,Post p,OwnerPost op, Owner o, Photos photos WHERE u.userid=a.ownerid and op.owner_postid=p.postid and op.ownerid=u.userid and o.ownerid=u.userid and o.ownerid=a.ownerid and b.buildingid=a.buildingid and a.apartmentid=op.apartmentid and photos.postid=p.postid and photos.postid=op.owner_postid")
+    @Query("select u.ime,u.prezime,u.phone_number,u.email_address,a.apartmentsize,a.apartmentfloorandroomnumber,b.buildingaddress,p.price,photos.photosurl from Building b,User u, Apartment a,Post p,OwnerPost op, Owner o, Photos photos WHERE u.userid=a.ownerid and op.ownerpostid=p.postid and op.ownerid=u.userid and o.ownerid=u.userid and o.ownerid=a.ownerid and b.buildingid=a.buildingid and a.apartmentid=op.apartmentid and photos.postid=p.postid and photos.postid=op.ownerpostid")
     List allapartments();
 }
Index: cimeri-main/src/main/java/com/example/cimeri/repository/CityRepository.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/repository/CityRepository.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/repository/CityRepository.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -2,6 +2,8 @@
 
 import com.example.cimeri.model.City;
+import com.example.cimeri.model.User;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
@@ -13,4 +15,5 @@
 
 
-
+    @Query("select c.cityname from City c WHERE c.cityid=:cityid")
+    String findCityByCityId(@Param("cityid")Long cityid);
 }
Index: cimeri-main/src/main/java/com/example/cimeri/repository/OwnerPostRepository.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/repository/OwnerPostRepository.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/repository/OwnerPostRepository.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -15,5 +15,5 @@
 public interface OwnerPostRepository extends JpaRepository<OwnerPost,Long> {
 
-    @Query("select Max(owner_postid) from OwnerPost")
+    @Query("select Max(ownerpostid) from OwnerPost")
     Long findMaxOwnerPostID();
 
Index: cimeri-main/src/main/java/com/example/cimeri/repository/UserRepository.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/repository/UserRepository.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/repository/UserRepository.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -22,6 +22,6 @@
 
 
-    @Query("select u from User u,Student s,StudentPost sp,Post p WHERE u.userid=s.studentid and u.userid=sp.studentid and sp.student_postid=p.postid and p.number_of_roommates=:number_of_roommates and p.price<=:budget and p.cityname=:cityname and s.studentid!=:currentid")
-    List<User> findAllStudentsThatHavePosted(@Param("cityname")String cityname, @Param("number_of_roommates") int number_of_roommates, @Param("budget") int budget, @Param("currentid") Long currentid);
+    @Query("select u from User u,Student s,StudentPost sp,Post p WHERE u.userid=s.studentid and u.userid=sp.studentid and sp.studentpostid=p.postid and p.numberofroommates=:number_of_roommates and p.price<=:budget and p.cityid=:cityid and s.studentid!=:currentid")
+    List<User> findAllStudentsThatHavePosted(@Param("cityid")Long cityid, @Param("number_of_roommates") int number_of_roommates, @Param("budget") int budget, @Param("currentid") Long currentid);
 
 
Index: cimeri-main/src/main/java/com/example/cimeri/service/Implementation/UserServiceImplementation.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/service/Implementation/UserServiceImplementation.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/service/Implementation/UserServiceImplementation.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -27,6 +27,6 @@
 
     @Override
-    public List<User> filteredUsers(String cityname, int budget, int number_of_roommates, Long currentid) {
-        List<User> users=userRepository.findAllStudentsThatHavePosted(cityname,budget,number_of_roommates,currentid);
+    public List<User> filteredUsers(Long cityid, int budget, int number_of_roommates, Long currentid) {
+        List<User> users=userRepository.findAllStudentsThatHavePosted(cityid,budget,number_of_roommates,currentid);
 
 
Index: cimeri-main/src/main/java/com/example/cimeri/service/UserService.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/service/UserService.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/service/UserService.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -1,5 +1,4 @@
 package com.example.cimeri.service;
 
-import com.example.cimeri.model.Faculty;
 import com.example.cimeri.model.User;
 
@@ -9,5 +8,5 @@
     Long findMaxUserID();
     List<User> listAll();
-    List<User> filteredUsers(String cityname, int budget, int number_of_roommates,Long currentid);
+    List<User> filteredUsers(Long cityname, int budget, int number_of_roommates, Long currentid);
 
 
Index: cimeri-main/src/main/java/com/example/cimeri/web/controller/ListApartmentsController.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/web/controller/ListApartmentsController.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/web/controller/ListApartmentsController.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -1,6 +1,6 @@
 package com.example.cimeri.web.controller;
 
-import com.example.cimeri.model.User;
 import com.example.cimeri.repository.ApartmentRepository;
+import com.example.cimeri.repository.CityRepository;
 import jakarta.servlet.http.HttpSession;
 import org.springframework.stereotype.Controller;
@@ -20,7 +20,9 @@
 
     private final ApartmentRepository apartmentRepository;
+    private final CityRepository cityRepository;
 
-    public ListApartmentsController(ApartmentRepository apartmentRepository) {
+    public ListApartmentsController(ApartmentRepository apartmentRepository, CityRepository cityRepository) {
         this.apartmentRepository = apartmentRepository;
+        this.cityRepository = cityRepository;
     }
 
@@ -32,4 +34,5 @@
         int number_of_roommates= (int) httpSession.getAttribute("number_of_roommates");
         int budget= (int) httpSession.getAttribute("budget");
+        Long cityid= (Long) httpSession.getAttribute("cityid");
 
 
@@ -37,6 +40,7 @@
         httpSession.removeAttribute("number_of_roommates");
         httpSession.removeAttribute("budget");
+        httpSession.removeAttribute("cityid");
 
-        List filteredapartments=apartmentRepository.filteredapartments(cityname,number_of_roommates,budget);
+        List filteredapartments=apartmentRepository.filteredapartments(cityid,number_of_roommates,budget);
         model.addAttribute("filteredapartments",filteredapartments);
 
@@ -45,10 +49,12 @@
 
     @PostMapping
-    public String listneededapartments(@RequestParam int number_of_roommates, @RequestParam String cityname, @RequestParam int budget
+    public String listneededapartments(@RequestParam int number_of_roommates, @RequestParam Long cityid, @RequestParam int budget
             , HttpSession httpSession, Model model)
     {
 
+        String cityname= cityRepository.findCityByCityId(cityid);
         httpSession.setAttribute("number_of_roommates",number_of_roommates);
         httpSession.setAttribute("cityname",cityname);
+        httpSession.setAttribute("cityid",cityid);
         httpSession.setAttribute("budget",budget);
 
Index: cimeri-main/src/main/java/com/example/cimeri/web/controller/ListStudentsController.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/web/controller/ListStudentsController.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/web/controller/ListStudentsController.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -4,4 +4,5 @@
 import com.example.cimeri.model.StudentPost;
 import com.example.cimeri.model.User;
+import com.example.cimeri.repository.CityRepository;
 import com.example.cimeri.repository.PostRepository;
 import com.example.cimeri.repository.StudentPostRepository;
@@ -31,6 +32,7 @@
     private final FacultyService facultyService;
     private final UserService userService;
+    private final CityRepository cityRepository;
 
-    public ListStudentsController(PostRepository postRepository, StudentPostRepository studentPostRepository, UserRepository userRepository, FacultyService facultyService, UserService userService) {
+    public ListStudentsController(PostRepository postRepository, StudentPostRepository studentPostRepository, UserRepository userRepository, FacultyService facultyService, UserService userService, CityRepository cityRepository) {
         this.postRepository = postRepository;
         this.studentPostRepository = studentPostRepository;
@@ -38,4 +40,5 @@
         this.facultyService = facultyService;
         this.userService = userService;
+        this.cityRepository = cityRepository;
     }
 
@@ -43,15 +46,18 @@
     public String getPage(HttpSession httpSession,Model model) throws IOException {
 
-        String cityname= (String) httpSession.getAttribute("cityname");
+
         int number_of_roommates= (int) httpSession.getAttribute("number_of_roommates");
         int budget= (int) httpSession.getAttribute("budget");
         Long currentid= (Long) httpSession.getAttribute("currentid");
+        Long cityid= (Long) httpSession.getAttribute("cityid");
+        String cityname= (String) httpSession.getAttribute("cityname");
 
         httpSession.removeAttribute("cityname");
+        httpSession.removeAttribute("cityid");
         httpSession.removeAttribute("number_of_roommates");
         httpSession.removeAttribute("budget");
         httpSession.removeAttribute("currentid");
 
-        List<User> similarusers=userService.filteredUsers(cityname,number_of_roommates,budget,currentid);
+        List<User> similarusers=userService.filteredUsers(cityid,number_of_roommates,budget,currentid);
         model.addAttribute("similarusers",similarusers);
         return "liststudents";
@@ -60,8 +66,8 @@
 
     @PostMapping(value = "/createpost")
-    public String createpost(@RequestParam int number_of_roommates, @RequestParam String cityname, @RequestParam int budget
+    public String createpost(@RequestParam int number_of_roommates, @RequestParam Long cityid, @RequestParam int budget
             , HttpSession httpSession, Model model)
     {
-            Post post=new Post(cityname,number_of_roommates,budget, LocalDateTime.now(), "baram cimeri");
+            Post post=new Post(cityid,number_of_roommates,budget, LocalDateTime.now(), "baram cimeri");
             postRepository.save(post);
             Long maxPostID=postRepository.findMaxPostID();
@@ -73,7 +79,10 @@
             //do ovde se kreira studentpost
 
+
+            String cityname= cityRepository.findCityByCityId(cityid);
             httpSession.setAttribute("number_of_roommates",number_of_roommates);
             httpSession.setAttribute("cityname",cityname);
             httpSession.setAttribute("budget",budget);
+            httpSession.setAttribute("cityid",cityid);
 
 
Index: cimeri-main/src/main/java/com/example/cimeri/web/controller/PostApartmentController.java
===================================================================
--- cimeri-main/src/main/java/com/example/cimeri/web/controller/PostApartmentController.java	(revision bc30bcea3ff615e6e88eb82e7ffe63b4597301a8)
+++ cimeri-main/src/main/java/com/example/cimeri/web/controller/PostApartmentController.java	(revision 087ce2b336a24f84911c58dea0a514c5c29dec4d)
@@ -46,9 +46,11 @@
 
     @PostMapping(value = "/createpost")
-    public String createpost(@RequestParam int number_of_roommates, @RequestParam String cityname, @RequestParam int price
+    public String createpost(@RequestParam int number_of_roommates, @RequestParam Long cityid, @RequestParam int price
             , HttpSession httpSession, @RequestParam String building_adress, @RequestParam String apartment_adress, @RequestParam int apartment_size,
                              @RequestParam String photosurl, Model model)
     {
-        Post post=new Post(cityname,number_of_roommates,price, LocalDateTime.now(), "izdavam stan");
+
+
+        Post post=new Post(cityid,number_of_roommates,price, LocalDateTime.now(), "izdavam stan");
         postRepository.save(post);
         Long maxPostID=postRepository.findMaxPostID();
@@ -57,5 +59,6 @@
         httpSession.setAttribute("currentid",ownerID);
 
-        Building building=new Building(cityname,building_adress);
+
+        Building building=new Building(cityid,building_adress);
         buildingRepository.save(building);
         Long maxBuildingID=buildingRepository.findMaxBuildingID();
