Inner Join not like Inner Join in SQL


#1

There is GOOD Queryes in SQL, gives the same data - 2 records:

SELECT u.id
FROM customer.user u
INNER JOIN customer.auth_user a ON u.id = a.id AND a.disabled = false
WHERE u.email IS NOT NULL AND (u.email LIKE '%rcgdata.ru' OR u.email LIKE '%rc-g.ru')

SELECT u.id
FROM customer.user u
LEFT JOIN customer.auth_user a ON u.id = a.id AND a.disabled = false
WHERE a.login IS NOT NULL AND u.email IS NOT NULL
AND (u.email LIKE '%rcgdata.ru' OR u.email LIKE '%rc-g.ru')

SELECT u.id
FROM customer.user u, customer.auth_user a
WHERE u.id = a.id AND a.disabled = false
AND u.email IS NOT NULL AND (u.email LIKE '%rcgdata.ru' OR u.email LIKE '%rc-g.ru')
This is BAD Query, gives 23 records (simple left join):
SELECT u.id
FROM customer.user u
LEFT JOIN customer.auth_user a ON u.id = a.id AND a.disabled = false
WHERE u.email IS NOT NULL

This is a HQL query:

select u.id from AdminUserEntity u inner join u.auth a 
where a.disabled = false and u.email is not null 
and (u.email LIKE '%rcgdata.ru' OR u.email LIKE '%rc-g.ru')

This is the Hibernate log:

select
            adminusere0_.id as col_0_0_ 
        from
            customer.user adminusere0_ 
        inner join
            customer.auth_user authuseren1_ 
                on adminusere0_.id=authuseren1_.id 
        where
            authuseren1_.disabled=false 
            and (
                adminusere0_.email is not null
            ) 
            and (
                adminusere0_.email like '%rcgdata.ru' 
                or adminusere0_.email like '%rc-g.ru'
            )

And the result like a BAD Query (23 records)
Why in Hibernate Inner Join worked like a simple Left Join in SQL?
And Why if i write Left Join in HQL it’s worked like Left Outer Join? (I saw it in hibernate log)