[jboss-user] [JBoss Seam] - Using EntityQuery Restrictions in Code

paradigmza do-not-reply at jboss.com
Wed Jan 24 03:11:08 EST 2007


Hi,

I would like to know the proper way to use seam restriction in the code.

I used to have a way that worked in Seam 1.1.0 but it stopped working in 1.1.1  (hence must be the incorrect way to use them)


  | List<String> restrictions = new ArrayList<String>();
  | restrictions.add("username like #{'" + value + "%'}");
  | EntityQuery nameList = new MyUserList();
  | nameList.setRestrictions(restrictions);
  | Long i = nameList.getResultCount();
  | log.info("search.searchUserNames() called with count: #0", i);
  | 
and

  | List<String> restrictions = new ArrayList<String>();
  | restrictions.add("name like #{'" + value + "%'}");
  | EntityQuery clientList = new MyClientList();
  | clientList.setRestrictions(restrictions);
  | Long i = clientList.getResultCount();
  | log.info("search.searchClients() called with count: #0", i);
  | 

With the upgrade to Seam 1.1.1 the resultCount is every row in the table, so the restriction is not being used.

the value comes from
<h:inputText id="value" required="true" value="#{search.value}" />

I thought that it might have been the actual query so I changed it to
restrictions.add("username like concat(#{search.value},'%') ");

Any Help?
Thanks
Sean.

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

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



More information about the jboss-user mailing list