Description
Clemens Hahn opened DATAJDBC-579 and commented
I'm working with an abstract base entity model
abstract class BaseEntity(@Id open val id: Long?)
My concrete model extends this base entity like
data class Ticket(
override val id: Long? = null,
val title: String,
val comments: MutableSet<Comment>
) : BaseEntity(id)
When reading from the TicketRepository
I got the warning WARN 4594 — [ main] o.s.d.j.core.convert.ResultSetAccessor : ResultSet contains ID multiple times
.
I also noticed that the ID field is two times present in the query: DEBUG 4594 — [ main] o.s.jdbc.core.JdbcTemplate : Executing prepared SQL statement [SELECT "TICKET"."ID" AS "ID", "TICKET"."ID" AS "ID", "TICKET"."TITLE" AS "TITLE" FROM "TICKET" WHERE "TICKET"."ID" = ?]
Is it possible to use base entities? I did not noticed this warning in spring-data-jdbc 1.1.5.RELEASE (but also the duplicate ID in the SELECT statement).
Please feel free to use my showcase in order to reproduce this scenario at GitHub (ticket/DATAJDBC-579
branch)
Affects: 2.1 M1 (2020.0.0)