[jboss-cvs] jboss-seam/src/main/org/jboss/seam/framework ...

Gavin King gavin.king at jboss.com
Tue Oct 3 13:16:45 EDT 2006


  User: gavin   
  Date: 06/10/03 13:16:45

  Modified:    src/main/org/jboss/seam/framework  Query.java
  Log:
  abstract JSF valuebindings / expressionbindings
  
  Revision  Changes    Path
  1.3       +6 -6      jboss-seam/src/main/org/jboss/seam/framework/Query.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Query.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/Query.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Query.java	28 Sep 2006 01:47:33 -0000	1.2
  +++ Query.java	3 Oct 2006 17:16:45 -0000	1.3
  @@ -7,12 +7,12 @@
   import java.util.Map;
   import java.util.StringTokenizer;
   
  -import javax.faces.context.FacesContext;
  -import javax.faces.el.ValueBinding;
   import javax.faces.model.DataModel;
   import javax.persistence.EntityManager;
   
   import org.jboss.seam.annotations.Intercept;
  +import org.jboss.seam.core.Expressions;
  +import org.jboss.seam.core.Expressions.ValueBinding;
   import org.jboss.seam.jsf.ListDataModel;
   
   @Intercept(NEVER)
  @@ -69,7 +69,7 @@
         javax.persistence.Query query = getEntityManager().createQuery(ejbql);
         for (int i=0; i<queryParameters.size(); i++)
         {
  -         Object parameterValue = queryParameters.get(i).getValue( FacesContext.getCurrentInstance() );
  +         Object parameterValue = queryParameters.get(i).getValue();
            if (parameterValue==null)
            {
               return null;
  @@ -139,7 +139,7 @@
               if ( "#".equals(token) )
               {
                  String expression = token + ejbqlTokens.nextToken() + ejbqlTokens.nextToken();
  -               queryParameters.add( FacesContext.getCurrentInstance().getApplication().createValueBinding(expression) );
  +               queryParameters.add( Expressions.instance().createValueBinding(expression) );
                  ejbqlBuilder.append("?").append( queryParameters.size() );
               }
               else
  @@ -159,7 +159,7 @@
                  if ( "#".equals(token) )
                  {
                     String expression = token + tokens.nextToken() + tokens.nextToken();
  -                  valueBinding = FacesContext.getCurrentInstance().getApplication().createValueBinding(expression);
  +                  valueBinding = Expressions.instance().createValueBinding(expression);
                     builder.append("?").append( queryParameters.size() );
                  }
                  else
  @@ -174,7 +174,7 @@
                  throw new IllegalArgumentException("no value binding in restriction: " + restriction);
               }
               
  -            Object parameterValue = valueBinding.getValue( FacesContext.getCurrentInstance() );
  +            Object parameterValue = valueBinding.getValue();
               if (parameterValue!=null)
               {
                  queryParameters.add(valueBinding);
  
  
  



More information about the jboss-cvs-commits mailing list