Czar
12/25/2018, 12:41 PM@Entity class MyEntity(val id: Long?, ...)
val myEntity = myEntityRepository.getById(1L)
// fun useMyEntityId(id: Long) {...}
useMyEntityId(checkNotNull(myEntity.id)) // check here is logically unnecessary, since entity retrieved from database will always have id
I'm asking in general, but if there is anything specific for Spring Boot and Hibernate, that would be also interesting.@Entity class MyEntity(val id: Long = 0L, ...)
just works 😄