June 25th, 2013, 02:33 PM
One query in 3 conditions
0 down vote favorite
I have one table in database that contains 3 foreign keys to another tables(this three tables name are: manager,worker and employee). in each row only one foreign key is filled.I need to write one query that with attention which column of fk is filled in where clause specified condition is performed. I write simple query in jpa but doesn't work properly
select b from allEmployees b where b.manager.name= :name OR b.worker.name = :name OR b.employee.name= :name
June 26th, 2013, 12:28 PM
The query you wrote is not valid for JPA or any of the known sql languages.
Originally Posted by sepand