-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Labels
type: bugSomething isn't workingSomething isn't working
Description
Expected Behavior
I'm running into an issue trying to use CursoredPageable on a repository whose entity is keyed by a complex primary key modeled as an @EmbeddedId . For example:
@Embeddable
public record AssetId(
@MappedProperty("container_id")
UUID containerId,
@MappedProperty("asset_id")
Integer assetId
) {
}
@MappedEntity("assets")
public record EphemeralAsset(
@EmbeddedId
AssetId id
){}
@JdbcRepository(dialect = Dialect.POSTGRES)
public interface EphemeralAssetsRepository extends PageableRepository<EphemeralAsset, AssetId> {
CursoredPage<EphemeralAsset> findByIdContainerId(UUID containerId, CursoredPageable pageable);
}
When invoking findByContainerId the generated query tries to add a sort clause for assets.id which is a column that does not exist. I think the EmbeddedId should be expanded to sort clauses for both assets.container_id and assets.asset_id. Is this a bug in Micronaut Data query generation or a misunderstanding on how EmbeddedId should be working?
Actual Behaviour
When invoking findByContainerId the generated query tries to add a sort clause for assets.id which is a column that does not exist.
Steps To Reproduce
No response
Environment Information
No response
Example Application
Version
4.8.2
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't workingSomething isn't working