Skip to content

Error querying entity with @IdClass #176

Closed
@francescopace

Description

@francescopace

I've an entity bean with @IdClass annotation (multiple id columns).
This kind of annotation is not well supported by this framework and every query will fail due to:

You should change that, to something like this:

        if(entityType.hasSingleIdAttribute()){
            SingularAttribute<?,?> idAttribute = entityType.getId(Object.class);
            ...
        }else{
            ...
        }

Alternatively you can delete that line and change query statement

in

query.select(cb.count(root));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions