I'm using DynamicQL with a SearchObject (Value Object for searching) the 
following way. Maybe it gives you a hint for the LIKE. This is working on 3.2.x.

  | public abstract Collection ejbSelectGeneric(String jbossQl, Object[] args) 
throws FinderException;
  | 
  | /**
  |  * @ejb.home-method
  |  */
  | public Collection ejbHomeGetBySearch(SearchObject so) throws 
FinderException {
  |     ArrayList argsList = new ArrayList();
  |     StringBuffer jbossQl = new StringBuffer();
  |     jbossQl.append("SELECT OBJECT(t) ");
  |     jbossQl.append("FROM Table_x t ");
  |     int bindCount = 0;
  |     if (so.getNumberCriterion()) {
  |             bindCount++;
  |             jbossQl.append((bindCount == 1 ? "WHERE" : "AND") + " t.column1 
LIKE ?" + bindCount + " ");
  |             argsList.add(so.getColumn1());
  |     }
  |     if (so.getTitleCriterion()) {
  |             bindCount++;
  |             jbossQl.append((bindCount == 1 ? "WHERE" : "AND") + " t.column2 
LIKE ?" + bindCount + " ");
  |             argsList.add(so.getColumn2());
  |     }
  |     jbossQl.append("ORDER BY t.column1 ASC");
  |     Object[] args = argsList.toArray();
  |     return ejbSelectGeneric(jbossQl.toString(), args);
  | }
  | 

Johan

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3856339#3856339

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3856339


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to