Marcel Overdijk
11/26/2018, 8:33 PMMarcel Overdijk
11/26/2018, 8:34 PMMarcel Overdijk
11/26/2018, 8:35 PMMarcel Overdijk
11/26/2018, 8:36 PMCountry
association Continent
like:Marcel Overdijk
11/26/2018, 8:37 PM@Entity
class Country(
@Id
var id: String,
var alpha2Code: String,
var alpha3Code: String,
var name: String,
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "continent_id")
var continent: Continent
)
Marcel Overdijk
11/26/2018, 8:37 PMMarcel Overdijk
11/26/2018, 8:37 PMMarcel Overdijk
11/26/2018, 8:38 PMval country = countryRepository.findById("netherlands").get()
assertEquals("europe", country.continent.id)
Marcel Overdijk
11/26/2018, 8:39 PMcountry.continent.id
should not cause the continent to be fetched, but with above Kotlin it is (causing additional query).Marcel Overdijk
11/26/2018, 8:40 PMMarcel Overdijk
11/26/2018, 8:43 PMMarcel Overdijk
11/26/2018, 8:43 PMMarcel Overdijk
11/26/2018, 8:45 PMMarcel Overdijk
11/29/2018, 7:32 AMxenoterracide
03/18/2019, 5:19 PMJeff White
04/11/2019, 6:42 PMDave Jensen
12/18/2019, 7:21 PMTim Schraepen
11/25/2021, 9:48 AMvalue class
as an @Id
field?
First our integration test was complaining that the class wasn’t Serializable (on save), after we fixed that we got an error on retrieval saying something about an Invalid Type.Tim Schraepen
12/06/2021, 4:39 PMAaron Shakib
02/07/2023, 2:18 AMAaron Shakib
02/07/2023, 2:19 AM