ejbql « ejb « Java Enterprise Q&A





1. Is this valid EJB-QL?    stackoverflow.com

I have the following construct in EJB-QL several EJB 2.1 finder methods:

SELECT distinct OBJECT(rd) FROM RequestDetail rd, DetailResponse dr 
      WHERE dr.updateReqResponseParentID is not null 
 ...

2. case-insensitive search in EJB QL    stackoverflow.com

This looks really simple and I can't believe I haven't found a solution myself. I have a bean named PersonBean, which has a name. Now I want to write a finder ...

3. EJB-QL exception    stackoverflow.com

select DISTINCT TOP 10 o.MaterialNumber from MaterialCreation_MDO o where o.MaterialGroup= ?1 and o.Noun= ?2 and o.MaterialNumber like ?3 order by o.MaterialNumber desc this query is throwing exception on encountering 'TOP' keyword ...

4. EJB-QL question how would I set a list as a parameter like: select o from table where id in (List listOfIds)    stackoverflow.com

IN EJB-QL I am trying to create a query like this:

SELECT * 

FROM table 

WHERE id IN ([id1],[id2],[id3],...);
This is a normal query for oracle or mysql but how can I make ...

5. is there a way to programatically determine the EJB entity class and id column from the table name?    stackoverflow.com

is there a way to programatically determine the EJB entity class and id column from the table name? I have the table name, what I want is a way to get the ...

6. How to set parameters within '' in EJB query    stackoverflow.com

In EJB query, it's recommended to use setParameters() instead of concatenating string parameters in order to avoid SQL injection attack. My question is: how to set parameters within '' in SQL update ...