[jboss-user] [JBoss Seam] - Why a STATIC RESTRICTIONS in Seam-gen EntityQuery?

boevink do-not-reply at jboss.com
Wed Feb 13 08:12:40 EST 2008


All sessionbean lists generated by seam-gen provide an implementation of an EntityQuery class.

Why is the String[] of RESTRICTIONS marked as Static? as shown below:


  | package web.session;
  | 
  | import web.entity.user.*;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.framework.EntityQuery;
  | import java.util.List;
  | import java.util.Arrays;
  | 
  | @Name("userList")
  | public class UserList extends EntityQuery {
  | 
  | 	private static final String[] RESTRICTIONS = {
  | 			"lower(email) like concat(lower(#{userList.user.email}),'%')",
  | 			"lower(password) like concat(lower(#{userList.user.password}),'%')",
  | 			"lower(username) like concat(lower(#{userList.user.username}),'%')", };
  | 
  | 	private User user = new User();
  | 
  | 	@Override
  | 	public String getEjbql() {
  | 		return "select user from User user";
  | 	}
  | 
  | 	@Override
  | 	public Integer getMaxResults() {
  | 		return 25;
  | 	}
  | 
  | 	public User getUser() {
  | 		return user;
  | 	}
  | 
  | 	@Override
  | 	public List<String> getRestrictions() {
  | 		return Arrays.asList(RESTRICTIONS);
  | 	}
  | 
  | }
  | 

The only place currently reffering to this attribute is within the class itself (getRestrictions).
Or am I missing something?



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

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



More information about the jboss-user mailing list