I am using JPA repository to access Mysql. I have this query :
@Query("Select s.productName, s.stock from Sell s");
I am getting an execution error because stock is sometime null.
The generated sql translation of this query is :
select sell0_.productName, sell0_.stock_id from T_SELL sell0_ inner join T_STOCK stock0_ on sell0_.stock_id=stock0_.id
Is there a way to make this JPA query work even if stock_id is null?