1

I want to make a query for an entity.The entity has a list of Objects.What i want is,querying for a field of this list and returning the entity again.

I wrote the code like this but it did not work :

<query>select distinct i from Is as i where :k MEMBER OF i.cars.color and i.id=1 </query>

The cars is a list and has a relation many to one with Is entity.How can i make it succesfull? Thanks in advance.

akinKaplanoglu
  • 728
  • 2
  • 8
  • 26
  • Mr @Yuliam you know how to edit this question,but you did not know the answer ,didn't you ? – akinKaplanoglu Sep 16 '14 at 11:19
  • look this question http://stackoverflow.com/questions/2687690/jpa-2-and-hibernate-3-5-1-member-of-query-doesnt-work, it can be helpful for you .. – Ozkan Ciftci Sep 16 '14 at 11:25
  • thanks @OzkanCiftci but it is not a solution to my question – akinKaplanoglu Sep 16 '14 at 11:27
  • @AknKplnoglu, nope, I didn't know the answer, you used irrelevant tag, I simply removed it, entity framework is orm in .net, not related to this question – Yuliam Chandra Sep 16 '14 at 11:28
  • I found the solution in this post thanks to everyone [link](http://stackoverflow.com/questions/16523420/hql-how-to-write-join-query-between-tables-that-has-one-to-many-relationship) – akinKaplanoglu Sep 16 '14 at 12:56

0 Answers0