IllegalArgumentException when restricting query by part of a composite primary key

Description

I have a simple entity with a composite primary key:

Now I want to create a query to get all ConversationMeta for a particular Conversation:

The criteriaBuilder.equal(conversationMeta.get(ConversationMeta_.conversation), conversation) fails with IllegalArgumentException: Unaware how to convert value. The ConversationMeta_ metamodel class appears to be generating correctly, listing the conversation attribute as SingularAttribute<ConversationMeta, Conversation> which is why I'm checking for equality with a Conversation and not an int. But the attribute in reality has a javaType of int, which is why the Conversation entity is being converted.

Changing the ConversationMeta.Id class to contain Conversation and Person entities, rather than {{int}}s is a fine workaround. I just wanted to record this odd behavior.

Environment

None

Status

Assignee

Unassigned

Reporter

Tim Whitbeck

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure