QueryDSL / HQL using ordinal instead of desired String value in leftJoin part

I am getting the following error while executing my request

Caused by: org.postgresql.util.PSQLException: FEHLER: Operator existiert nicht: bigint = character varying

      

Important part of the request:

[...]
    query.leftJoin(qSomeObj.obj2, qObj2).on(qObj2.col1.eq(enumValue);
    query.where(qSomeObj.obj2.isNull());
[...]

      

The field in my value object is annotated like below:

[...]
@Column(name = "col1", nullable = false)
@Enumerated(EnumType.STRING)
private MyEnum col1;
[...]

      

It seems that the last SQL query contains the ordinal enumValue instead of the desired string. If I put the same Predicate in the where clause, there is no such error, so it seems that it responds to the annotation in the value object and uses a String.

Is this some kind of bug in QueryDSL or Hibernate? Or maybe I am doing something wrong. Any suggestions would be appreciated.

EDIT:

I think the first time I was wrong. It's not the enum ordinal that is messing with my query. In fact, the enumeration is treated as a string, and therefore as a "parameter changing" in the error message. But the order of the parameters is flawed. In addition to the parts I've already posted, I have a filter for each relationship. It's bigint, so the first parameter of my requests should be clientId, but that's the name of the enum value.

+3


source to share





All Articles