[jboss-user] [JBoss Seam] - EntityQuery Restrictions

griffitm do-not-reply at jboss.com
Wed Oct 24 11:29:00 EDT 2007


Hello All, 

I have some components generated by seamgen, specifically the EntityQuery Lists that relate to a list of entity objects.  The seam generated search form allows the restrictions to be passed to the query:

  | public class StatusList extends EntityQuery {
  | 
  | 	private static final String[] RESTRICTIONS = {"lower(status.description) like concat('%', concat(lower(#{statusList.status.description}),'%'))",};
  | ...
  | 	private Status status = new Status();
  | 
  | 	@Override
  | 	public String getEjbql() {
  | 		return "select status from Status status order by status.sortOrder";
  | 	}
  | ...
The query works well if no parameters are passed to the restrictions, the list is returned in the correct order, however if I pass a parameter to the restrictions clause the predicates of where/order are mixed up and invalid SQL is executed, which of course produces an error.

What is the correct way to approach this?

Thanks in advance!
MG


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

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



More information about the jboss-user mailing list