i am new in spring boot. i have hotel class and address class. relation between hotel and address is one to many. i want to search addresses with hotel id.

Hotel Class:

```
@OneToMany(cascade = CascadeType.ALL)
private List<Address> address;

```

Address class:

```
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "hotel_id", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@JsonIgnore
private Hotel hotel;

```

controller:

```
@GetMapping("/search/{hotelId}")
public String searchAddressHotel(@PathVariable("hotelId") Long hotelId, Model model){

    List<Address> addresses= addressService.findAddressByHotelId(hotelId);
    model.addAttribute("addresses", addresses);

    return "address-list";
}

```

view:

```
<table class="table">
        <thead>
        <tr>
            <th scope="col">Id</th>
            <th scope="col">Road Number</th>
            <th scope="col">City</th>
            <th scope="col">Country</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="address: ${addresses}">
            <th scope="row" th:text="${address.id}"></th>
            <td th:text="${address.roadNumber}"></td>
            <td th:text="${address.city}"></td>
            <td th:text="${address.country}"></td>
        </tr>

        </tbody>

```

Repository:

```
@Repository
public interface AddressRepository extends JpaRepository<Address, Long> {
        List<Address>findAddressByHotel(Long hotelId);
}

```

when i am searching with this link ( localhost:8080/search/1 ) in browser, show this exception:

```
2019-07-22 14:33:09.340 ERROR 12216 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [1] did not match expected type [com.shaon.SpringBootLogin.model.Hotel (n/a)]; nested exception is java.lang.IllegalArgumentException: Parameter value [1] did not match expected type [com.shaon.SpringBootLogin.model.Hotel (n/a)]] with root cause

java.lang.IllegalArgumentException: Parameter value [1] did not match expected type [com.shaon.SpringBootLogin.model.Hotel (n/a)]

```

why hotel id did not match with hotel id column in address table. please help me.