[jboss-cvs] jboss-seam/seam-gen/src ...

Gavin King gavin.king at jboss.com
Sat Dec 16 08:26:10 EST 2006


  User: gavin   
  Date: 06/12/16 08:26:10

  Modified:    seam-gen/src  EntityList.java.ftl
  Log:
  JBSEAM-477, search screens
  
  Revision  Changes    Path
  1.4       +25 -0     jboss-seam/seam-gen/src/EntityList.java.ftl
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EntityList.java.ftl
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/seam-gen/src/EntityList.java.ftl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- EntityList.java.ftl	10 Dec 2006 16:53:28 -0000	1.3
  +++ EntityList.java.ftl	16 Dec 2006 13:26:10 -0000	1.4
  @@ -5,11 +5,25 @@
   
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.framework.EntityQuery;
  +import java.util.List;
  +import java.util.Arrays;
   
   @Name("${listName}")
   public class ${entityName}List extends EntityQuery
   {
   
  +    private static final String[] RESTRICTIONS = {
  +<#foreach property in pojo.allPropertiesIterator>
  +<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
  +<#if property.value.typeName == "string">
  +        "lower(${componentName}.${property.name}) like concat(lower(${'#'}{${listName}.${componentName}.${property.name}}),'%')",
  +</#if>
  +</#if>
  +</#foreach>
  +    };
  +
  +    private ${entityName} ${componentName} = new ${entityName}();
  +
       @Override
       public String getEjbql() 
       { 
  @@ -22,4 +36,15 @@
       	return 25;
       }
       
  +    public ${entityName} get${entityName}()
  +    {
  +        return ${componentName};
  +    }
  +    
  +    @Override
  +    public List<String> getRestrictions()
  +    {
  +        return Arrays.asList(RESTRICTIONS);
  +    }
  +
   }
  
  
  



More information about the jboss-cvs-commits mailing list