Description
My Spring Data JDBC entity is implementing Persistable
and is annotated with @AccessType(Type.PROPERTY)
at the class level.
When I invoke save
on my repository, I get the following exception from the underlying JDBC implementation:
java.sql.SQLException: Unknown column 'new' in 'field list'
Indeed, looking at the executed query, Spring Data JDBC is also specifying the column new
in the insert statement. I think it comes from the implementation of org.springframework.data.domain.Persistable.isNew()
.
I take the opportunity to ask a question: is it true that implementing Persistable
allows me to avoid to mark the primary key field with @Id
, being the implementation of org.springframework.data.domain.Persistable.getId()
enough for the framework to detect the primary key? It's not very clear from the documentation.