It runs ok, but it doesn't return any rows. Based on the data it should. I remove the first part of the where clause in the hibernate query and it returns the expected rows.
Here's the sql query with that modified query:
Code:
Hibernate: select distinct mbus0_.id as id0_, mbus0_.system_entry as system2_0_, mbus0_.busy_entry as busy3_0_, mbus0_.status as status0_, mbus0_.bus_number as bus5_0_, mbus0_.bus_size as bus6_0_, mbus0_.bus_price_brutto as bus7_0_, mbus0_.initial_payment as initial8_0_, mbus0_.date_initial_payment as date9_0_, mbus0_.final_payment_done as final10_0_, mbus0_.date_final_payment as date11_0_, mbus0_.driver as driver0_, mbus0_.driver_handy as driver13_0_, mbus0_.new_bus as new14_0_, mbus0_.event_ref as event16_0_, mbus0_.event_location_ref as event18_0_, mbus0_.departure_region_ref as departure15_0_, mbus0_.bus_company_ref as bus19_0_, mbus0_.bus_owner as bus17_0_ from t_mbs_bus mbus0_, t_mbs_bus_asignation mbusassign1_, t_mbs_bus_route mbusroute2_, t_mbs_departure_region mdeparture3_, t_mbs_region mregion4_ where mbus0_.id=mbusassign1_.bus_id and mbusassign1_.bus_route_ref=mbusroute2_.id and mbusroute2_.departure_region_ref=mdeparture3_.id and mdeparture3_.region_ref=mregion4_.id and (mregion4_.name like ?) order by mbus0_.id DESC
:-(