Hibernate version: 3.1.*
RequisitoZona is a subclass of Requisito with discriminator tipo = 'Z'
Requisito has a TipoDocumento property and TipoDocumento has Set<Requisito> property.
HQL
Code:
select
d,
r
from
RequisitoZona as r
right outer join
r.tipoDocumento as d
with r.zona = :zona
Generated SQLCode:
select
...
from
requisito requisitoz0_
right outer join
tipos_documento tipodocume1_
on requisitoz0_.idTipodocumento=tipodocume1_.id
and (
requisitoz0_.idAsignado=?
)
where
requisitoz0_.tipo='Z'
SQL I wantCode:
select
...
from
requisito requisitoz0_
right outer join
tipos_documento tipodocume1_
on requisitoz0_.idTipodocumento=tipodocume1_.id
and (
requisitoz0_.idAsignado=?
)
and
requisitoz0_.tipo='Z'