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
hql querydsl


source to share


No one has answered this question yet

Check out similar questions:

five
QueryDsl - case expression with string value
3
Creating a querydsl expression
2
Use QueryDSL to eliminate hibernate hql parsing
2
Hibernate: Initialize all children with one join clause in HQL / QueryDSL?
1
how to use querydsl instead of SQL
1
QueryDSL: how to select literals as part of SQLSubQuery?
0
HQL string match percentage
0
Constant boolean value in Querydsl
0
How can I extract the string value from the StringPath value in querydsl?
0
HQL query - part of matches of strings with part of a string



All Articles
Loading...
X
Show
Funny
Dev
Pics