custom query - how can we fetch the set of records based on BDM type attribute in custom query ?
Actually the issue is I think in your query syntax. Actually as Employee and EmployeeType are two different tables you need to have a join (AFAIK, I'm not a JPQL expert).
Here is a version that I think should do what you want:
SELECT e FROM Employee e JOIN e.eType type WHERE type.persistenceId = :inputId ORDER BY e.persistenceId ASC
I have tried to use this syntax for joining two tables but it is returning null even when there is matching.
This query is possible in community version as well?
Why are you using a separate table "employeeType" just to hold a list of strings? I'd make the "eType" field of "employee" a string, and then it's simple.
Thanks for replying...
I am using a separate table because it will be helpful while preparing a report based on employeeType. instead of user entering the text he will select it from the dropdown, other wise the user may enter text with spelling mistakes.