-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
When constructing the query, the "prefix" field of the @Embedded
annotation is not respected. For example:
Let's say you have an entity:
@Table("matches")
record Match(
Integer matchId,
@Embedded(onEmpty = USE_NULL, prefix = "player1_")
Player playerOne,
@Embedded(onEmpty = USE_NULL, prefix = "player2_")
Player playerTwo
) {}
record Player(
Integer id,
String name
) {}
If you invoke a method from a repository that extends QuerydslJdbcFragment
in this fashion:
repository.queryMany(q -> q.select(this.entityProjection()).from(player));
You will get an exception ERROR: column match.id does not exist
.
It probably gets the id from the player embedded object, but ignores the prefix. The method should instead include columns player1_id, player1_name, player2_id, player2_name
.
Metadata
Metadata
Assignees
Labels
No labels