There are the following two entities:
One country can have many cities and a city can belong to only one country. There are corresponding JPA entities with a unidirectional relationship:
Java
@Entity
public class Country {
@Id
private int id;
private String name;
{1}
{2}(name = {3})
private List<City> cities;
}
@Entity
public class City {
{4}
private int id;
private String name;
}
Kotlin
@Entity
class Country(
@Id
var id: Int = 0,
var name: String? = null,
{1}
{2}(name = {3})
var cities: MutableList<City> = ArrayList()
)
@Entity
class City(
{4}
var id: Int = 0,
var name: String? = null
)
Match the missed annotations and their parameters.