Q:

Hibernate query using or shows no results

We're trying to execute the following query through HQL, but we're stuck and this query is showing us no results.
select s from Serie s where
(s.arrivalSerie is not null and s.arrivalSerie.company.isEnable=1)
or (s.departureSerie is not null and s.departureSerie.company.isEnable=1)

We're throwing this query with:
Query query = em.createQuery("previous query");
query.setFirstResult(initialElement);

While testing this query we find out any part of this query ("or") can be executed with results. But when the whole query is executed we get 0 elements collection.
Any ideas?
UPDATE:
An understandable translated query would be something like this:
select
        s.*
    from
        serie s,
        arrivalSerie a,
        company ca,
        departureSerie d,
        company cd 
    where
        s.idArrivalSerie=a.idArrivalSerie 
        and a.CompanyCode=ca.CompanyCode 
        and s.idDepartureSerie=d.idDepartureSerie 
        and d.CompanyCode=cd.CompanyCode 
        and (
            (
                s.idArrivalSerie is not null
            ) 
            and ca.isEnable=1 
            or (
                s.idDepartureSerie is not null
            ) 
            and cd.isEnable=1
        ) limit 0,10;

Of course this is not showing us results on a MySql Client

A:

s.arrivalSerie.company

creates an inner join between Serie and ArrivalSerie, and another inner join between ArrivalSerie and Company. And an inner join will filter out all the Series that have a null arrivalSerie, which is clearly not what you want. So you need to use left joins instead:
select s from Serie s 
left join s.arrivalSerie arrivalSerie
left join arrivalSerie.company arrivalCompany
left join s.departureSerie departureSerie
left join departureSerie.company departureCompany
where arrivalCompany.isEnable = 1 or departureCompany.isEnable = 1

