-
Notifications
You must be signed in to change notification settings - Fork 367
Closed
Description
Maciej Walkowiak opened DATAJDBC-286 and commented
When working with one-to-one relationships, if child entity is immutable it's impossible to fetch entities from the database.
As far as my investigation has gone, the reason is that column prefix is not passed when data is extracted from result set.
Example:
SELECT movie.id AS id, movie.title AS title, movie.description AS description, movie.released_date AS released_date, rental.duration AS rental_duration, rental.price AS rental_price, rental.movie AS rental_movie FROM movie LEFT OUTER JOIN movie_rental AS rental ON rental.movie = movie.id
When mapping Rental
entity, Spring Data JDBC currently extracts "duration", "price" instead of "rental_duration" and "rental_price". This works fine with HSQL JDBC driver, but not with PostgreSQL (possibly reason explained at https://www.postgresql.org/message-id/[email protected])
This issue affects only immutable entities. If fields are not final
, different mechanism fires up that uses prefixes for getting data from JDBC ResultSet
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug