We're updating the issue view to help you get more done. 

SOME AND parenthesis are required in the SQL query

Description

I have a named query that has some required parenthesis
statement 1 and (satatement 1.1 or statement 1.2)

and HQL convert it to

statement 1 and statement 1.1 or statement 1.2

in my case to make it work I have to add statement 1 twice to have the correct result.
statement 1 and statement 1.1 or statement 1 and statement 1.2

I won't give you the whole name query unless you asked for it but in my case it was something like:
_Select user
From User user
Where user.id = :userId AND (user.assetCount>0 or user.permission.canCreateAsset = true)_

Hope it makes sense.

Environment

Spring with hibernate ans MariaDB 10.

Status

Assignee

Unassigned

Reporter

Jerome Preli

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.2.21

Priority

Critical