Bad query generated with or / and conditions in parenthesis

Description

I used HQL to query 2 tables with and / or conditions which need parenthesis : (a = 'user' OR a is null AND b = 'xxx')

query is like this :
select pal from Priority as pal, Preparation as pre where … and
(pre.user = :user or pre.user is null and pre.exit = :typeExit) …
order by …

THEN, the request done in DB is :
select pal from Priority as pal, Preparation as pre where … and
(pre.user=$3 or (pre.user is null) and pre.exit=$4) …
order by …

Here, parenthesis are not at the same place, which change the query, and then the result.

I did few other tests to find a turnover without success.
Example with additional parenthesis :
(pre.user = :user or (pre.user is null and pre.exit = :typeExit))

Environment

Windows/Linux
hibernate-core 4.2.5-final
postgres 9.x

Status

Assignee

Unassigned

Reporter

BertrandL

Labels

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Affects versions

Priority

Major
Configure