Hi all!
I´m executing this kind of HQL:
Code:
select new ModelView(obj1.propA, obj1.obj2.propB) from Objeto obj1
There is a relation OneToOne beetwen obj1 and its relationship with obj2 defined like this:
Code:
public class Objeto{
...
@OneToOne(cascade = {CascadeType.ALL }, fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
private Object2 obj2;
...
All I need is that the query results even if obj2 is null... but the SQL generated is something like this:
select o1.propA, o2.propB
from object1 o1, object2 o2
where o1.id = o2.idrefo1
So, can´t I tell hibernate to generate the joins with (+), so if value is null, the relationships returns something. I have checked documentation and I´ve seen that optional is false by default.
Can somebody help me, please?