I\'m writing java application using hibernate 5.2 but without HQL
hibernate 5.2
HQL
there is two table, Transactions and ResponseCode
Transactions
ResponseCode
Change the relation from @OneToOne to @OneToMany and use fetch instead of join , it will execute only one query and hopefully it works.
@OneToOne
@OneToMany
fetch
join
Join join = (Join)transaction.fetch("rc",JoinType.LEFT);
and you can try it with @OneToOne too.