Hi all
I have a table List(onwer_id, list_title, pers_id). The primary key for this table is owner_id, list_title, pers_id and the data in the table is : 1, "title_1", 1
1, "title_1", 2
1, "title_2", 1
1, "title_2", 3
1, " title_2",4
I would like to get distinct list_title(ex: "title_1" and "title_2") of owner having id=1
Here is my EJB_QL
If I use this : "SELECT OBJECT(L) FROM List L WHERE L.owner_id=?" and I input 1 into my ejbFinder method. It will return all the rows in the table.(I don't want this solution)
If I use this : "SELECT DISTINCT L.list_title FROM List L WHERE L.owner_id=?"(This will return only "title_1" and "title_2" as I wanted but this throws an ClassCastException when I use EJBRemote interface to cast the object from the returned collection to the remote interface. However, If I cast the object in the returned collection to
String object It will work but does not return "title_1" and "title_2"
pls provide any suggestion or solution to this problem.
Thanks in advanced