I\'m using Hibernate 3.6 and MSSQL 2012.
When executing this HQL
select tbl.state from Property tbl where tbl.state = 1 and tbl.entity.state = 1 and
Your join is an inner join, but using the old syntax consisting in adding a condition in the where clause:
where property0_.refEntityid=entity1_.id
instead of doing it with
inner join Entities entity1_ on property0_.refEntityid=entity1_.id
The result is exactly the same.
And using implicit joins in HQL is not a problem at all, as long as you understand what they're doing.
When using HQL, always use proper aliases when performing join operations.Your query should be something like that:
select tbl.state
from Property tbl
left join tbl.entity entity
where tbl.state = 1
and entity.state = 1
and entity.className = 'com....'
and tbl.fieldName = 'fieldName'
Otherwise if you try to use tbl.entity.someProperty
, in HQL, it will always create a crossJoin