I have problem with executing following query:
from Customer c where c.connectedUserID = 1 and (c.connectedFinancialAnalyst is null or c.connectedFinancialAnalyst.completed = false)
object c.connectedFinancialAnalyst can be null. What I need is to find Customers that dont have financial analyst or property in financial analyst has specific value.
Edit: completed property is boolean in postgres and in java
Output generated by Hibernate
select
customer0_.id as id1_0_,
customer0_.birthDate as birthDat2_0_,
customer0_.birthPlace as birthPla3_0_,
customer0_.city as city4_0_,
customer0_.email as email5_0_,
customer0_.fatherName as fatherNa6_0_,
customer0_.motherName as motherNa7_0_,
customer0_.name as name8_0_,
customer0_.pesel as pesel9_0_,
customer0_.phoneNumber as phoneNu10_0_,
customer0_.postalCode as postalC11_0_,
customer0_.secondName as secondN12_0_,
customer0_.sex as sex13_0_,
customer0_.street as street14_0_,
customer0_.surname as surname15_0_,
customer0_.connectedFinancialAnalyst_id as connect17_0_,
customer0_.connectedUserID as connect16_0_
from
Customer customer0_ cross
join
FinancialAnalyst financiala1_
where
customer0_.connectedFinancialAnalyst_id=financiala1_.id
and customer0_.connectedUserID=1
and (
customer0_.connectedFinancialAnalyst_id is null
or financiala1_.completed='false'
)
Completedis it VARCHAR or BIT ??'false'. i.e enclosed inside single quotes'. Check out thislinkhere.